Commit b09e60f3 by lujunyi

添加医药

parent 4e7ae425
...@@ -74,7 +74,6 @@ protected function grid() ...@@ -74,7 +74,6 @@ protected function grid()
$grid->disableViewButton(); // 禁用详情按钮 $grid->disableViewButton(); // 禁用详情按钮
// 工具栏按钮控制 // 工具栏按钮控制
$grid->disableCreateButton(); // 禁用创建按钮
$grid->disableBatchDelete(); // 禁用批量删除 $grid->disableBatchDelete(); // 禁用批量删除
// 导出按钮 // 导出按钮
......
...@@ -36,8 +36,10 @@ class DrugModel extends Model ...@@ -36,8 +36,10 @@ class DrugModel extends Model
self::RX_FALSE => '否', self::RX_FALSE => '否',
]; ];
public function setCodeAttribute($value) public function setNameAttribute($value)
{ {
$this->attributes['name'] = $value;
$pinyin = new Pinyin(); $pinyin = new Pinyin();
$abbr = $pinyin->abbr($this->name)->join(''); // 获取拼音首字母 $abbr = $pinyin->abbr($this->name)->join(''); // 获取拼音首字母
$this->attributes['code'] = strtoupper($abbr); $this->attributes['code'] = strtoupper($abbr);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment