count(); } public static function getApplyShop($params) { $list = self::where(['shop_id'=>$params['shop_id'],'state'=>$params['state']])->field('id,skill_id,skill_name,state')->order('id desc')->page($params['page'])->limit(10)->select(); foreach ($list as $key=>$value) { $skillInfo = Skill::skillInfo($value['skill_id']); $list[$key]['skillInfo'] = $skillInfo; $list[$key]['skillScore'] = Skill::getSkillScore($value['skill_id']); } return $list; } /** * 审核 * @param $get * @return bool * @throws \think\db\exception\DataNotFoundException * @throws \think\db\exception\ModelNotFoundException * @throws \think\exception\DbException */ public static function check($get) { $info = self::where(['id'=>$get['id'],'state'=>0])->field('id,state,skill_id,shop_id')->find(); if(!$info) { return false; } if($get['state'] == 1) { $update['shop_id'] = $info['shop_id']; $update['percent'] = $get['percent']; Shop::where('id',$info['shop_id'])->setInc('already_service_nums'); \app\api\model\service\Skill::where(['id'=>$info['skill_id']])->update($update); } self::where(['id'=>$info['id']])->update(['state'=>$get['state']]); return true; } }