'已删除', self::IS_DEL_NO => '未删除' ]; /** * The table associated with the model. * * @var string */ protected $table = 'life_cinema_performers'; public $timestamps = false; /** * Notes:获取演职列表 * @param string $keywords * @param int $page * @param int $limit * @return array * User: ZQ * Date: 2022/9/13 */ public static function getPerformersList(int $page, int $limit, string $keywords) { $list = static::select('*') ->where(['performers_is_del'=>static::IS_DEL_NO]) ->when($keywords != '', function ($query) use ($keywords){ $query->where('performers_name', 'like', '%' . $keywords . '%'); }) ->orderBy('performers_create_time','DESC') ->forPage($page, $limit) ->get(); $count = static::where(['performers_is_del'=>static::IS_DEL_NO]) ->when($keywords != '', function ($query) use ($keywords){ $query->where('performers_name', 'like', '%' . $keywords . '%'); }) ->count(); return [$list, $count]; } /** * Notes:获取所有演职 * @return array * User: ZQ * Date: 2022/9/19` */ public static function getPerformersAll($type) { $list = static::select(['performers_id','performers_name']) ->where(['performers_is_del'=>static::IS_DEL_NO,'performers_type'=>$type]) ->orderBy('performers_create_time','DESC') ->get(); return $list; } /** * Notes:获取名称 * @param string $account * @return \Illuminate\Database\Eloquent\Builder|\Illuminate\Database\Eloquent\Model|object|null * User: ZQ * Date: 2022/9/19 */ public static function performersMation($admin_performers) { $where = []; $where['performers_is_del'] = static::IS_DEL_NO; $mation = static::where($where) ->when($admin_performers != '', function ($query) use ($admin_performers){ $query->whereIn('performers_id', $admin_performers); }) ->get('performers_name'); return $mation; } }