0]); if (isset($where['obtain']) && $where['obtain'] > 0) $model = $model->where('obtain', $where['obtain']); if (isset($where['title']) && $where['title'] != '') $model = $model->where('title', 'like', "%$where[title]%"); if (isset($where['mer_id']) && $where['mer_id'] != '') $model = $model->where('mer_id', 'in',$where['mer_id']); $model = $model->where('institution_id', 0); return $model; } /**证书列表 * @param $where 条件 */ public static function getCertificateList($where) { $data = self::setWhere($where)->page((int)$where['page'], (int)$where['limit'])->order('sort desc,add_time desc')->select(); foreach ($data as $key => &$value) { switch ($value['obtain']) { case 1: $value['obtains'] = '课程'; break; case 2: $value['obtains'] = '考试'; break; } } $count = self::setWhere($where)->count(); return compact('data', 'count'); } /** * 证书列表 */ public static function certificateList($mer_id) { $list = self::where(['is_del' => 0, 'mer_id' => $mer_id])->order('sort desc,add_time desc')->select(); return $list; } }