hasOne('\App\Models\LanzuMmWithdraw','mm_id','id'); } /** * 获取市场经理(只搜索状态为正常的经理) * id为键,name为值 */ public static function getMmInfoArray() { $list = self::select('id','name') ->where('status',2) ->whereNull('deleted_at') ->get(); $array = []; if(count($list) > 0){ foreach ($list as $key => $value){ $array[$value->id] = $value->name; } } return $array; } /** * 根据id获取单条记录 */ public static function getMmInfo($id,$field = '*') { return self::select($field)->find($id); } }