BelongsTo('app\common\model\user\User', 'user_id', 'user_id'); } /** * 核销员详情 */ public static function detail($where, $with = ['user']) { $filter = is_array($where) ? $where : ['clerk_id' => $where]; return (new static())->with($with)->where(array_merge(['is_delete' => 0], $filter))->find(); } /** * 状态 */ public function getStatusAttr($value) { $status = [0 => '禁用', 1 => '启用']; return ['text' => $status[$value], 'value' => $value]; } }