12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- <?php
- /**
- * @author: xaboy<365615158@qq.com>
- * @day: 2017/11/13
- */
- namespace app\admin\model\system;
- use crmeb\traits\ModelTrait;
- use crmeb\basic\BaseModel;
- /**
- * 数据组model
- * Class SystemGroup
- * @package app\admin\model\system
- */
- class SystemGroup extends BaseModel
- {
- /**
- * 数据表主键
- * @var string
- */
- protected $pk = 'id';
- /**
- * 模型名称
- * @var string
- */
- protected $name = 'system_group';
- use ModelTrait;
- /**
- * 根据id获取当前记录中的fields值
- * @param $id
- * @return array
- */
- public static function getField($id){
- $fields = json_decode(self::where('id',$id)->value("fields"),true)?:[];
- return compact('fields');
- }
- }
|