From e0aca3b55f37e9d5b6b189fbf71c2829f6215a87 Mon Sep 17 00:00:00 2001 From: yangsai Date: Tue, 15 Oct 2024 14:54:05 +0800 Subject: [PATCH] 20241015 --- app/massage/controller/AdminCoach.php | 15 +- app/massage/controller/AdminSetting.php | 2 +- app/massage/controller/AdminUser.php | 9 +- app/massage/controller/Index.php | 682 +++++++++--------- app/massage/controller/IndexCoach.php | 14 +- app/massage/controller/IndexUser.php | 15 +- app/massage/model/Coach.php | 84 ++- app/massage/model/Commission.php | 9 +- app/massage/model/Order.php | 9 +- app/massage/route/route.php | 1 + app/mobilenode/controller/IndexAgentOrder.php | 11 +- 后端UI/src/api/modules/service.js | 9 +- 后端UI/src/view/custom/list.vue | 31 + 后端UI/src/view/finance/finance/record.vue | 4 + 后端UI/src/view/shop/order/bell.vue | 30 + 后端UI/src/view/shop/order/list.vue | 36 +- 后端UI/src/view/technician/edit.vue | 17 +- 后端UI/src/view/technician/list.vue | 12 + 18 files changed, 584 insertions(+), 406 deletions(-) diff --git a/app/massage/controller/AdminCoach.php b/app/massage/controller/AdminCoach.php index c98a96eb..13412f59 100644 --- a/app/massage/controller/AdminCoach.php +++ b/app/massage/controller/AdminCoach.php @@ -155,13 +155,18 @@ class AdminCoach extends AdminRest } $data = $this->model->dataList($dis,$input['limit'],$where); - + $level_model = new CoachLevel(); if(!empty($data['data'])){ foreach ($data['data'] as &$v){ - + $v['levelname'] = "无等级"; + $v['balance'] = "0%"; //$user_model->checkCoachCash($v); - + if($v['level']){ + $levelinfo = $level_model->dataInfo(['id'=>$v['level']]); + $v['levelname'] = $levelinfo['title']; + $v['balance'] = $levelinfo['balance'].'%'; + } $v['partner_name'] = $user_model->where(['id'=>$v['partner_id']])->value('nickName'); //绑定门店 if(!empty($v['store_id'])){ @@ -184,7 +189,7 @@ class AdminCoach extends AdminRest 5=>'update_num' ]; - + foreach ($list as $k=> $value){ $dis_s = []; @@ -195,7 +200,7 @@ class AdminCoach extends AdminRest $dis_s[] = ['admin_id','in',$this->admin_arr]; } - + if(!empty($k)&&$k!=5){ $dis_s[] = ['status','=',$k]; diff --git a/app/massage/controller/AdminSetting.php b/app/massage/controller/AdminSetting.php index b55a85a4..eca9399e 100644 --- a/app/massage/controller/AdminSetting.php +++ b/app/massage/controller/AdminSetting.php @@ -925,7 +925,7 @@ class AdminSetting extends AdminRest ]; $cash_model = new Commission(); - + $cash = $cash_model->where($dis)->where('type','in',[2,5,6])->find(); if(!empty($cash)){ diff --git a/app/massage/controller/AdminUser.php b/app/massage/controller/AdminUser.php index 2420fc3e..ebd8f9fa 100644 --- a/app/massage/controller/AdminUser.php +++ b/app/massage/controller/AdminUser.php @@ -651,7 +651,14 @@ class AdminUser extends AdminRest } - + public function delUser(){ + $input = $this->_param; + $input['ids'] = rtrim($input['id'],','); + $ids = explode(",",$input['ids']); + $result = $this->model->where('id','in',$ids)->delete(); + return $this->success($result); + + } /** diff --git a/app/massage/controller/Index.php b/app/massage/controller/Index.php index 917f0836..b2f75e29 100644 --- a/app/massage/controller/Index.php +++ b/app/massage/controller/Index.php @@ -70,94 +70,94 @@ class Index extends ApiRest * @DataTime: 2021-03-23 09:20 * @功能说明:首页 */ - public function index(){ + public function index(){ - $input = $this->_param; + $input = $this->_param; - $dis = [ + $dis = [ - 'uniacid' => $this->_uniacid, + 'uniacid' => $this->_uniacid, - 'status' => 1 - ]; - $data['banner'] = $this->banner_model->where($dis)->field('id,img,link,type_id,connect_type')->order('top desc,id desc')->select()->toArray(); + 'status' => 1 + ]; + $data['banner'] = $this->banner_model->where($dis)->field('id,img,link,type_id,connect_type')->order('top desc,id desc')->select()->toArray(); - $cate_model = new CateList(); + $cate_model = new CateList(); - $data['service_cate'] = $cate_model->where($dis)->field('title,id,cover')->order('top desc,id desc')->select()->toArray(); - //判断插件权限没有返回空 - $config_model = new ConfigSetting(); + $data['service_cate'] = $cate_model->where($dis)->field('title,id,cover')->order('top desc,id desc')->select()->toArray(); + //判断插件权限没有返回空 + $config_model = new ConfigSetting(); - $config = $config_model->dataInfo($this->_uniacid,['recommend_style','coach_apply_show','auto_recommend']); + $config = $config_model->dataInfo($this->_uniacid,['recommend_style','coach_apply_show','auto_recommend']); - $data = array_merge($data,$config); + $data = array_merge($data,$config); - if(!empty(['recommend'])||['recommend']==true){ + if(!empty(['recommend'])||['recommend']==true){ - $where[] = ['uniacid','=',$this->_uniacid]; + $where[] = ['uniacid','=',$this->_uniacid]; - $where[] = ['status','=',2]; + $where[] = ['status','=',2]; - $where[] = ['auth_status','=',2]; + $where[] = ['auth_status','=',2]; - $where[] = ['is_work','=',1]; + $where[] = ['is_work','=',1]; - // $where[] = ['user_id','>',0]; + // $where[] = ['user_id','>',0]; - if(!empty($input['city_id'])){ + if(!empty($input['city_id'])){ - $where[] = ['city_id','=',$input['city_id']]; - } + $where[] = ['city_id','=',$input['city_id']]; + } - if(!empty($this->getUserId())){ + if(!empty($this->getUserId())){ - $shield_coach = $this->coach_model->getShieldCoach($this->getUserId()); + $shield_coach = $this->coach_model->getShieldCoach($this->getUserId()); - if(!empty($shield_coach)){ + if(!empty($shield_coach)){ - $where[] = ['id','not in',$shield_coach]; - } - } + $where[] = ['id','not in',$shield_coach]; + } + } - $lat = !empty($input['lat'])?$input['lat']:0; + $lat = !empty($input['lat'])?$input['lat']:0; - $lng = !empty($input['lng'])?$input['lng']:0; + $lng = !empty($input['lng'])?$input['lng']:0; - $alh = 'ACOS(SIN(('.$lat.' * 3.1415) / 180 ) *SIN((lat * 3.1415) / 180 ) +COS(('.$lat.' * 3.1415) / 180 ) * COS((lat * 3.1415) / 180 ) *COS(('.$lng.' * 3.1415) / 180 - (lng * 3.1415) / 180 ) ) * 6378.137*1000 as distance'; - //手动推荐 - if($data['auto_recommend']==0){ + $alh = 'ACOS(SIN(('.$lat.' * 3.1415) / 180 ) *SIN((lat * 3.1415) / 180 ) +COS(('.$lat.' * 3.1415) / 180 ) * COS((lat * 3.1415) / 180 ) *COS(('.$lng.' * 3.1415) / 180 - (lng * 3.1415) / 180 ) ) * 6378.137*1000 as distance'; + //手动推荐 + if($data['auto_recommend']==0){ - $list = $this->coach_model->coachRecommendSelect($where,$alh); - }else{ - //自动推荐 - $list = $this->coach_model->aotuCoachRecommendSelect($where,$alh); + $list = $this->coach_model->coachRecommendSelect($where,$alh); + }else{ + //自动推荐 + $list = $this->coach_model->aotuCoachRecommendSelect($where,$alh); - } + } - if(!empty($list)){ + if(!empty($list)){ - $order_model = new Order(); - //最近七天注册 - $seven = $this->model->getSaleTopSeven($this->_uniacid); + $order_model = new Order(); + //最近七天注册 + $seven = $this->model->getSaleTopSeven($this->_uniacid); - foreach ($list as &$v){ - //是否是新人 - $v['is_new'] = in_array($v['id'],$seven)?1:0; - //近30天单量 - $v['order_count'] = $order_model->where(['coach_id' => $v['id'], 'pay_type' => 7])->whereTime('create_time','-30 days')->count(); + foreach ($list as &$v){ + //是否是新人 + $v['is_new'] = in_array($v['id'],$seven)?1:0; + //近30天单量 + $v['order_count'] = $order_model->where(['coach_id' => $v['id'], 'pay_type' => 7])->whereTime('create_time','-30 days')->count(); - } + } - } + } - $data['recommend_list'] = $list; + $data['recommend_list'] = $list; - } + } - return $this->success($data); + return $this->success($data); - } + } /** @@ -237,59 +237,59 @@ class Index extends ApiRest * @DataTime: 2021-03-23 14:16 * @功能说明:获取配置信息 */ - public function configInfo(){ + public function configInfo(){ - $dis = [ + $dis = [ - 'uniacid' => $this->_uniacid - ]; + 'uniacid' => $this->_uniacid + ]; - $config_model = new Config(); + $config_model = new Config(); - $config_model->dataInfo($dis); + $config_model->dataInfo($dis); - $arr = 'agent_article_id,bus_end_time,uniacid,appsecret,app_app_secret,appid,app_app_id,web_app_id,web_app_secret,gzh_appid,order_tmp_id,cancel_tmp_id,max_day,time_unit,service_cover_time,can_tx_time,company_pay,short_id,short_secret'; + $arr = 'agent_article_id,bus_end_time,uniacid,appsecret,app_app_secret,appid,app_app_id,web_app_id,web_app_secret,gzh_appid,order_tmp_id,cancel_tmp_id,max_day,time_unit,service_cover_time,can_tx_time,company_pay,short_id,short_secret'; - $config = $config_model->where($dis)->withoutField($arr)->find()->toArray(); + $config = $config_model->where($dis)->withoutField($arr)->find()->toArray(); - $pay_config_model = new PayConfig(); + $pay_config_model = new PayConfig(); - $pay_config = $pay_config_model->dataInfo($dis); + $pay_config = $pay_config_model->dataInfo($dis); - $config['alipay_status'] = $pay_config['alipay_status']; + $config['alipay_status'] = $pay_config['alipay_status']; - $short_config_model = new ShortCodeConfig(); + $short_config_model = new ShortCodeConfig(); - $short_config = $short_config_model->dataInfo($dis); + $short_config = $short_config_model->dataInfo($dis); - $config['short_code_status'] = $short_config['short_code_status']; - //代理商文章标题 - if(!empty($config['agent_article_id'])){ + $config['short_code_status'] = $short_config['short_code_status']; + //代理商文章标题 + if(!empty($config['agent_article_id'])){ - $article_model = new ArticleList(); + $article_model = new ArticleList(); - $config['agent_article_title'] = $article_model->where(['id'=>$config['agent_article_id']])->value('title'); - } + $config['agent_article_title'] = $article_model->where(['id'=>$config['agent_article_id']])->value('title'); + } - $config_model = new ConfigSetting(); + $config_model = new ConfigSetting(); - $data = $config_model->dataInfo($this->_uniacid,['order_contact_coach','service_recording_show','coach_level_show','attendant_name','service_start_recording','service_end_recording','coach_apply_show','recharge_status','recommend_style','coach_format','wechat_transfer','alipay_transfer','under_transfer']); + $data = $config_model->dataInfo($this->_uniacid,['order_contact_coach','service_recording_show','coach_level_show','attendant_name','service_start_recording','service_end_recording','coach_apply_show','recharge_status','recommend_style','coach_format','wechat_transfer','alipay_transfer','under_transfer']); - $config = array_merge($config,$data); + $config = array_merge($config,$data); - $auth = AdminMenu::getAuthList((int)$this->_uniacid,['dynamic','recommend','store','map','recording']); + $auth = AdminMenu::getAuthList((int)$this->_uniacid,['dynamic','recommend','store','map','recording']); - $config_model = new MassageConfig(); + $config_model = new MassageConfig(); - $config_data = $config_model->dataInfo(['uniacid'=>$this->_uniacid]); + $config_data = $config_model->dataInfo(['uniacid'=>$this->_uniacid]); - $auth['dynamic'] = !empty($config_data['dynamic_status'])?$auth['dynamic']:0; + $auth['dynamic'] = !empty($config_data['dynamic_status'])?$auth['dynamic']:0; - $config['plugAuth'] = $auth; - $config['login_set'] = []; - return $this->success($config); + $config['plugAuth'] = $auth; + $config['login_set'] = []; + return $this->success($config); - } + } /** @@ -298,90 +298,90 @@ class Index extends ApiRest * @功能说明:技师的服务列表 */ - public function coachServiceList(){ + public function coachServiceList(){ - $input = $this->_param; + $input = $this->_param; - $dis[] = ['a.uniacid','=',$this->_uniacid]; + $dis[] = ['a.uniacid','=',$this->_uniacid]; - $dis[] = ['a.status','=',1]; + $dis[] = ['a.status','=',1]; - $dis[] = ['a.check_status','=',2]; + $dis[] = ['a.check_status','=',2]; - if(!empty($input['coach_id'])){ + if(!empty($input['coach_id'])){ - $dis[] = ['b.coach_id','=',$input['coach_id']]; - } + $dis[] = ['b.coach_id','=',$input['coach_id']]; + } - $is_add = !empty($input['is_add'])?$input['is_add']:0; + $is_add = !empty($input['is_add'])?$input['is_add']:0; - $dis[] = ['a.is_add','=',$is_add]; - //判断插件权限没有返回空 - $auth = AdminMenu::getAuthList((int)$this->_uniacid,['store']); + $dis[] = ['a.is_add','=',$is_add]; + //判断插件权限没有返回空 + $auth = AdminMenu::getAuthList((int)$this->_uniacid,['store']); - if(empty($auth['store'])){ + if(empty($auth['store'])){ - $dis[] = ['a.type','=',1]; - } + $dis[] = ['a.type','=',1]; + } - $data['data'] = $this->model->serviceCoachList($dis); + $data['data'] = $this->model->serviceCoachList($dis); - $data['car_price'] = $data['car_count'] = 0; + $data['car_price'] = $data['car_count'] = 0; - if(!empty($data['data'])){ + if(!empty($data['data'])){ - $car_model = new Car(); + $car_model = new Car(); - $store_model = new StoreList(); + $store_model = new StoreList(); - foreach ($data['data'] as $k=>&$v){ - //代理商服务 服务的代理商和技师关联门店的代理商必须相同 - if($v['type']==2&&!empty($input['coach_id'])){ + foreach ($data['data'] as $k=>&$v){ + //代理商服务 服务的代理商和技师关联门店的代理商必须相同 + if($v['type']==2&&!empty($input['coach_id'])){ - $coach_id = $store_model->getAdminStoreCoach($v['admin_id']); + $coach_id = $store_model->getAdminStoreCoach($v['admin_id']); - if(!in_array($input['coach_id'],$coach_id)){ + if(!in_array($input['coach_id'],$coach_id)){ - unset($data['data'][$k]); + unset($data['data'][$k]); - continue; - } + continue; + } - } + } - $dis = [ + $dis = [ - 'service_id' => $v['id'], + 'service_id' => $v['id'], - 'coach_id' => $input['coach_id'], + 'coach_id' => $input['coach_id'], - 'user_id' => $this->getUserId(), + 'user_id' => $this->getUserId(), - 'status' => 1, + 'status' => 1, - // 'order_id' => 0 - ]; + // 'order_id' => 0 + ]; - $car_info = $car_model->dataInfo($dis); + $car_info = $car_model->dataInfo($dis); - $v['car_id'] = !empty($car_info)?$car_info['id']:0; + $v['car_id'] = !empty($car_info)?$car_info['id']:0; - $v['car_num'] = !empty($car_info)?$car_info['num']:0; + $v['car_num'] = !empty($car_info)?$car_info['num']:0; - if(!empty($car_info)){ + if(!empty($car_info)){ - $data['car_price'] += $v['price']*$v['car_num']; + $data['car_price'] += $v['price']*$v['car_num']; - $data['car_count'] += $v['car_num']; + $data['car_count'] += $v['car_num']; - } + } - } - } + } + } - return $this->success($data); + return $this->success($data); - } + } @@ -390,192 +390,192 @@ class Index extends ApiRest * @DataTime: 2021-07-07 10:21 * @功能说明:服务技师列表 */ - public function serviceCoachList(){ + public function serviceCoachList(){ - $input = $this->_param; + $input = $this->_param; - $dis[] = ['a.uniacid','=',$this->_uniacid]; + $dis[] = ['a.uniacid','=',$this->_uniacid]; - $dis[] = ['a.status','=',2]; + $dis[] = ['a.status','=',2]; - $dis[] = ['auth_status','=',2]; + $dis[] = ['auth_status','=',2]; - $dis[] = ['a.is_work','=',1]; + $dis[] = ['a.is_work','=',1]; - // $dis[] = ['a.user_id','>',0]; + // $dis[] = ['a.user_id','>',0]; - if(!empty($input['ser_id'])){ + if(!empty($input['ser_id'])){ - $dis[] = ['b.ser_id','=',$input['ser_id']]; - } + $dis[] = ['b.ser_id','=',$input['ser_id']]; + } - if(!empty($input['coach_name'])){ + if(!empty($input['coach_name'])){ - $dis[] = ['a.coach_name','like','%'.$input['coach_name'].'%']; - } + $dis[] = ['a.coach_name','like','%'.$input['coach_name'].'%']; + } - if(!empty($input['city_id'])){ + if(!empty($input['city_id'])){ - $dis[] = ['a.city_id','=',$input['city_id']]; - } + $dis[] = ['a.city_id','=',$input['city_id']]; + } - if(!empty($input['sex'])){ + if(!empty($input['sex'])){ - $dis[] = ['a.sex','=',$input['sex']]; - } + $dis[] = ['a.sex','=',$input['sex']]; + } - if(!empty($input['work_time_start'])&&!empty($input['work_time_end'])){ + if(!empty($input['work_time_start'])&&!empty($input['work_time_end'])){ - $dis[] = ['a.work_time','between',"{$input['work_time_start']},{$input['work_time_end']}"]; + $dis[] = ['a.work_time','between',"{$input['work_time_start']},{$input['work_time_end']}"]; - } + } - if(!empty($input['cate_id'])){ + if(!empty($input['cate_id'])){ - $cate_model = new CateConnect(); + $cate_model = new CateConnect(); - $id = $cate_model->where(['cate_id'=>$input['cate_id']])->column('service_id'); + $id = $cate_model->where(['cate_id'=>$input['cate_id']])->column('service_id'); - $dis[] = ['b.ser_id','in',$id]; + $dis[] = ['b.ser_id','in',$id]; - } + } - if(!empty($input['store_id'])){ + if(!empty($input['store_id'])){ - $store_model = new \app\store\model\StoreList(); + $store_model = new \app\store\model\StoreList(); - $store_coach_id = $store_model->getStoreCoachId($input['store_id']); + $store_coach_id = $store_model->getStoreCoachId($input['store_id']); - $dis[] = ['a.id','in',$store_coach_id]; + $dis[] = ['a.id','in',$store_coach_id]; - } - //服务中 - $working_coach = $this->coach_model->getWorkingCoach($this->_uniacid); - //当前时间不可预约 - $cannot = CoachTimeList::getCannotCoach($this->_uniacid); + } + //服务中 + $working_coach = $this->coach_model->getWorkingCoach($this->_uniacid); + //当前时间不可预约 + $cannot = CoachTimeList::getCannotCoach($this->_uniacid); - $working_coach = array_diff($working_coach,$cannot); - //如果登录不返回被屏蔽的技师 - if(!empty($this->getUserId())){ + $working_coach = array_diff($working_coach,$cannot); + //如果登录不返回被屏蔽的技师 + if(!empty($this->getUserId())){ - $shield_coach = $this->coach_model->getShieldCoach($this->getUserId()); + $shield_coach = $this->coach_model->getShieldCoach($this->getUserId()); - if(!empty($input['service_time'])){ - //服务中 - $working_coach = $this->coach_model->getWorkingCoach($this->_uniacid,$input['service_time']); - //当前时间不可预约 - $cannot = CoachTimeList::getCannotCoach($this->_uniacid,$input['service_time']); + if(!empty($input['service_time'])){ + //服务中 + $working_coach = $this->coach_model->getWorkingCoach($this->_uniacid,$input['service_time']); + //当前时间不可预约 + $cannot = CoachTimeList::getCannotCoach($this->_uniacid,$input['service_time']); - $working_coach = array_merge($working_coach,$cannot); + $working_coach = array_merge($working_coach,$cannot); - $shield_coach = array_merge($working_coach,$shield_coach); + $shield_coach = array_merge($working_coach,$shield_coach); - } + } - if(!empty($shield_coach)){ + if(!empty($shield_coach)){ - $dis[] = ['a.id','not in',$shield_coach]; - } + $dis[] = ['a.id','not in',$shield_coach]; + } - } - //可服务不可服务 - if(!empty($input['type'])){ - //可服务 - if($input['type']==1){ + } + //可服务不可服务 + if(!empty($input['type'])){ + //可服务 + if($input['type']==1){ - $array = array_merge($working_coach,$cannot); + $array = array_merge($working_coach,$cannot); - $dis[] = ['a.id','not in',$array]; + $dis[] = ['a.id','not in',$array]; - }elseif($input['type']==2){//服务中 + }elseif($input['type']==2){//服务中 - $dis[] = ['a.id','in',$working_coach]; + $dis[] = ['a.id','in',$working_coach]; - }elseif ($input['type']==3){//可预约 + }elseif ($input['type']==3){//可预约 - $dis[] = ['a.id','in',$cannot]; - } + $dis[] = ['a.id','in',$cannot]; + } - } + } - $lat = !empty($input['lat'])?$input['lat']:0; + $lat = !empty($input['lat'])?$input['lat']:0; - $lng = !empty($input['lng'])?$input['lng']:0; + $lng = !empty($input['lng'])?$input['lng']:0; - $alh = 'ACOS(SIN(('.$lat.' * 3.1415) / 180 ) *SIN((a.lat * 3.1415) / 180 ) +COS(('.$lat.' * 3.1415) / 180 ) * COS((a.lat * 3.1415) / 180 ) *COS(('.$lng.' * 3.1415) / 180 - (a.lng * 3.1415) / 180 ) ) * 6378.137*1000 as distance'; + $alh = 'ACOS(SIN(('.$lat.' * 3.1415) / 180 ) *SIN((a.lat * 3.1415) / 180 ) +COS(('.$lat.' * 3.1415) / 180 ) * COS((a.lat * 3.1415) / 180 ) *COS(('.$lng.' * 3.1415) / 180 - (a.lng * 3.1415) / 180 ) ) * 6378.137*1000 as distance'; - $data = $this->coach_model->serviceCoachList($dis,$alh); + $data = $this->coach_model->serviceCoachList($dis,$alh); - if(!empty($data['data'])){ + if(!empty($data['data'])){ - $collect_model= new CoachCollect(); + $collect_model= new CoachCollect(); - $config_model = new Config(); + $config_model = new Config(); - $coach_model = new Coach(); + $coach_model = new Coach(); - $store_model = new StoreList(); + $store_model = new StoreList(); - $config= $config_model->dataInfo(['uniacid'=>$this->_uniacid]); + $config= $config_model->dataInfo(['uniacid'=>$this->_uniacid]); //销冠 - $top = $this->model->getSaleTopOne($this->_uniacid); + $top = $this->model->getSaleTopOne($this->_uniacid); //销售单量前5 - $five = $this->model->getSaleTopFive($this->_uniacid,$top); + $five = $this->model->getSaleTopFive($this->_uniacid,$top); //最近七天注册 - $seven = $this->model->getSaleTopSeven($this->_uniacid); + $seven = $this->model->getSaleTopSeven($this->_uniacid); - $user_id = !empty($this->getUserId())?$this->getUserId():0; + $user_id = !empty($this->getUserId())?$this->getUserId():0; - $collect = $collect_model->where(['user_id'=>$user_id])->column('coach_id'); + $collect = $collect_model->where(['user_id'=>$user_id])->column('coach_id'); - foreach ($data['data'] as &$v){ + foreach ($data['data'] as &$v){ - $v['store'] = $store_model->where(['id'=>$v['store_id'],'status'=>1])->field('id,title')->find(); + $v['store'] = $store_model->where(['id'=>$v['store_id'],'status'=>1])->field('id,title')->find(); - $v['is_collect'] = in_array($v['id'],$collect)?1:0; + $v['is_collect'] = in_array($v['id'],$collect)?1:0; - $v['near_time'] = $coach_model->getCoachEarliestTime($v['id'],$config); + $v['near_time'] = $coach_model->getCoachEarliestTime($v['id'],$config); - if (in_array($v['id'],$working_coach)){ + if (in_array($v['id'],$working_coach)){ - $text_type = 2; + $text_type = 2; - }elseif (!in_array($v['id'],$cannot)){ + }elseif (!in_array($v['id'],$cannot)){ - $text_type = 1; + $text_type = 1; - }else{ + }else{ - $text_type = 3; - } + $text_type = 3; + } - $v['text_type'] = $text_type; + $v['text_type'] = $text_type; - if($v['id']==$top){ + if($v['id']==$top){ - $v['coach_type_status'] = 1; + $v['coach_type_status'] = 1; - }elseif (in_array($v['id'],$five)){ + }elseif (in_array($v['id'],$five)){ - $v['coach_type_status'] = 2; + $v['coach_type_status'] = 2; - }elseif (in_array($v['id'],$seven)){ + }elseif (in_array($v['id'],$seven)){ - $v['coach_type_status'] = 3; + $v['coach_type_status'] = 3; - }else{ + }else{ - $v['coach_type_status'] = 0; + $v['coach_type_status'] = 0; - } + } - } + } - } + } - return $this->success($data); + return $this->success($data); - } + } /** @@ -583,17 +583,17 @@ class Index extends ApiRest * @DataTime: 2023-05-15 17:00 * @功能说明:代理商详情 */ - public function agentInfo(){ + public function agentInfo(){ - $input = $this->_param; + $input = $this->_param; - $admin_model = new \app\massage\model\Admin(); + $admin_model = new \app\massage\model\Admin(); - $data = $admin_model->where(['id'=>$input['admin_id']])->field('agent_name,id,license')->find(); + $data = $admin_model->where(['id'=>$input['admin_id']])->field('agent_name,id,license')->find(); - return $this->success($data); + return $this->success($data); - } + } /** @@ -601,162 +601,162 @@ class Index extends ApiRest * @DataTime: 2023-02-21 17:03 * @功能说明:第二中板式第技师列表 */ - public function typeServiceCoachList(){ + public function typeServiceCoachList(){ - $input = $this->_param; + $input = $this->_param; - $dis[] = ['a.uniacid','=',$this->_uniacid]; + $dis[] = ['a.uniacid','=',$this->_uniacid]; - $dis[] = ['a.status','=',2]; + $dis[] = ['a.status','=',2]; - $dis[] = ['auth_status','=',2]; + $dis[] = ['auth_status','=',2]; - // $dis[] = ['a.user_id','>',0]; + // $dis[] = ['a.user_id','>',0]; - if(!empty($input['ser_id'])){ + if(!empty($input['ser_id'])){ - $dis[] = ['b.ser_id','=',$input['ser_id']]; - } + $dis[] = ['b.ser_id','=',$input['ser_id']]; + } - if(!empty($input['coach_name'])){ + if(!empty($input['coach_name'])){ - $dis[] = ['a.coach_name','like','%'.$input['coach_name'].'%']; - } + $dis[] = ['a.coach_name','like','%'.$input['coach_name'].'%']; + } - if(!empty($input['store_id'])){ + if(!empty($input['store_id'])){ - $dis[] = ['a.store_id','=',$input['store_id']]; + $dis[] = ['a.store_id','=',$input['store_id']]; - } + } - if(!empty($input['sex'])){ + if(!empty($input['sex'])){ - $dis[] = ['a.sex','=',$input['sex']]; - } + $dis[] = ['a.sex','=',$input['sex']]; + } - if(!empty($input['city_id'])){ + if(!empty($input['city_id'])){ - $dis[] = ['a.city_id','=',$input['city_id']]; - } + $dis[] = ['a.city_id','=',$input['city_id']]; + } - if(!empty($input['work_time_start'])&&!empty($input['work_time_end'])){ + if(!empty($input['work_time_start'])&&!empty($input['work_time_end'])){ - $dis[] = ['a.work_time','between',"{$input['work_time_start']},{$input['work_time_end']}"]; + $dis[] = ['a.work_time','between',"{$input['work_time_start']},{$input['work_time_end']}"]; - } + } - if(!empty($input['cate_id'])){ + if(!empty($input['cate_id'])){ - $cate_model = new CateConnect(); + $cate_model = new CateConnect(); - $id = $cate_model->where(['cate_id'=>$input['cate_id']])->column('service_id'); + $id = $cate_model->where(['cate_id'=>$input['cate_id']])->column('service_id'); - $dis[] = ['b.ser_id','in',$id]; + $dis[] = ['b.ser_id','in',$id]; - } + } - $this->coach_model->setIndexTopCoach($this->_uniacid); - //如果登录不返回被屏蔽的技师 - if(!empty($this->getUserId())){ + $this->coach_model->setIndexTopCoach($this->_uniacid); + //如果登录不返回被屏蔽的技师 + if(!empty($this->getUserId())){ - $shield_coach = $this->coach_model->getShieldCoach($this->getUserId()); + $shield_coach = $this->coach_model->getShieldCoach($this->getUserId()); - if(!empty($input['service_time'])){ - //服务中 - $working_coach = $this->coach_model->getWorkingCoach($this->_uniacid,$input['service_time']); - //当前时间不可预约 - $cannot = CoachTimeList::getCannotCoach($this->_uniacid,$input['service_time']); + if(!empty($input['service_time'])){ + //服务中 + $working_coach = $this->coach_model->getWorkingCoach($this->_uniacid,$input['service_time']); + //当前时间不可预约 + $cannot = CoachTimeList::getCannotCoach($this->_uniacid,$input['service_time']); - $working_coach = array_merge($working_coach,$cannot); + $working_coach = array_merge($working_coach,$cannot); - $shield_coach = array_merge($working_coach,$shield_coach); + $shield_coach = array_merge($working_coach,$shield_coach); - } + } - if(!empty($shield_coach)){ + if(!empty($shield_coach)){ - $dis[] = ['a.id','not in',$shield_coach]; - } + $dis[] = ['a.id','not in',$shield_coach]; + } - } + } - $lat = !empty($input['lat'])?$input['lat']:0; + $lat = !empty($input['lat'])?$input['lat']:0; - $lng = !empty($input['lng'])?$input['lng']:0; + $lng = !empty($input['lng'])?$input['lng']:0; - $alh = 'ACOS(SIN(('.$lat.' * 3.1415) / 180 ) *SIN((a.lat * 3.1415) / 180 ) +COS(('.$lat.' * 3.1415) / 180 ) * COS((a.lat * 3.1415) / 180 ) *COS(('.$lng.' * 3.1415) / 180 - (a.lng * 3.1415) / 180 ) ) * 6378.137*1000 as distance'; + $alh = 'ACOS(SIN(('.$lat.' * 3.1415) / 180 ) *SIN((a.lat * 3.1415) / 180 ) +COS(('.$lat.' * 3.1415) / 180 ) * COS((a.lat * 3.1415) / 180 ) *COS(('.$lng.' * 3.1415) / 180 - (a.lng * 3.1415) / 180 ) ) * 6378.137*1000 as distance'; - $data = $this->coach_model->typeServiceCoachList($dis,$alh); + $data = $this->coach_model->typeServiceCoachList($dis,$alh); - if(!empty($data['data'])){ + if(!empty($data['data'])){ - $collect_model= new CoachCollect(); + $collect_model= new CoachCollect(); - $config_model = new Config(); + $config_model = new Config(); - $coach_model = new Coach(); + $coach_model = new Coach(); - $store_model = new StoreList(); + $store_model = new StoreList(); - $config= $config_model->dataInfo(['uniacid'=>$this->_uniacid]); - //销冠 - $top = $this->model->getSaleTopOne($this->_uniacid); - //销售单量前5 - $five = $this->model->getSaleTopFive($this->_uniacid,$top); - //最近七天注册 - $seven = $this->model->getSaleTopSeven($this->_uniacid); + $config= $config_model->dataInfo(['uniacid'=>$this->_uniacid]); + //销冠 + $top = $this->model->getSaleTopOne($this->_uniacid); + //销售单量前5 + $five = $this->model->getSaleTopFive($this->_uniacid,$top); + //最近七天注册 + $seven = $this->model->getSaleTopSeven($this->_uniacid); - $user_id = !empty($this->getUserId())?$this->getUserId():0; + $user_id = !empty($this->getUserId())?$this->getUserId():0; - $collect = $collect_model->where(['user_id'=>$user_id])->column('coach_id'); + $collect = $collect_model->where(['user_id'=>$user_id])->column('coach_id'); - foreach ($data['data'] as &$v){ + foreach ($data['data'] as &$v){ - $v['store'] = $store_model->where(['id'=>$v['store_id'],'status'=>1])->field('id,title')->find(); + $v['store'] = $store_model->where(['id'=>$v['store_id'],'status'=>1])->field('id,title')->find(); - $v['is_collect'] = in_array($v['id'],$collect)?1:0; + $v['is_collect'] = in_array($v['id'],$collect)?1:0; - $v['near_time'] = $coach_model->getCoachEarliestTime($v['id'],$config); + $v['near_time'] = $coach_model->getCoachEarliestTime($v['id'],$config); - if ($v['is_work']==0){ + if ($v['is_work']==0){ - $text_type = 4; + $text_type = 4; - }elseif ($v['index_top']==1){ + }elseif ($v['index_top']==1){ - $text_type = 1; + $text_type = 1; - }else{ + }else{ - $text_type = 3; - } + $text_type = 3; + } - $v['text_type'] = $text_type; + $v['text_type'] = $text_type; - if($v['id']==$top){ + if($v['id']==$top){ - $v['coach_type_status'] = 1; + $v['coach_type_status'] = 1; - }elseif (in_array($v['id'],$five)){ + }elseif (in_array($v['id'],$five)){ - $v['coach_type_status'] = 2; + $v['coach_type_status'] = 2; - }elseif (in_array($v['id'],$seven)){ + }elseif (in_array($v['id'],$seven)){ - $v['coach_type_status'] = 3; + $v['coach_type_status'] = 3; - }else{ + }else{ - $v['coach_type_status'] = 0; + $v['coach_type_status'] = 0; - } + } - } + } - } + } - return $this->success($data); - } + return $this->success($data); + } /** @@ -863,7 +863,7 @@ class Index extends ApiRest //目前只能加钟一个 if(!empty($order_id)){ - // $this->car_model->where(['order_id'=>$order_id])->delete(); + // $this->car_model->where(['order_id'=>$order_id])->delete(); } //从服务详情直接下单 if(!empty($input['coach_service'])){ @@ -1143,15 +1143,15 @@ class Index extends ApiRest // $url = 'https://apis.map.qq.com/ws/place/v1/suggestion?keyword='; $url = 'https://apis.map.qq.com/ws/geocoder/v1/?address='; - + $url = $url.$input['location'].'&key='.$config['map_secret']; - + $data = longbingCurl($url,[]); $data_arr = json_decode($data,true); - + if(!empty($data_arr['message'])&&$data_arr['message']=='Success'){ return $this->success($data_arr['result']); @@ -1281,12 +1281,12 @@ class Index extends ApiRest if(!empty($v['city'])){ if(!empty($_GET['city'])){ if($_GET['city'] != $v['city']){ - continue; + continue; } } - + } - + } if($v['user_limit']==2&&$user_info['create_time']>$time){ @@ -1297,18 +1297,18 @@ class Index extends ApiRest $list[] = $v; } - - - + + + } - - + + } $list = array_values($list); - + return $this->success($list); diff --git a/app/massage/controller/IndexCoach.php b/app/massage/controller/IndexCoach.php index 812b68c1..808e339c 100644 --- a/app/massage/controller/IndexCoach.php +++ b/app/massage/controller/IndexCoach.php @@ -278,9 +278,12 @@ class IndexCoach extends ApiRest */ public function orderList() { - + $input = $this->_param; + if (empty($this->cap_info['id'])) { + $this->errorMsg('你还不是技师'); + } $dis[] = ['a.uniacid', '=', $this->_uniacid]; $dis[] = ['a.coach_id', '=', $this->cap_info['id']]; @@ -422,7 +425,13 @@ class IndexCoach extends ApiRest 'text' => $input['text'], 'type' => $input['type'], - + 'chikaren' => !empty($input['chikaren'])?$input['chikaren']:'', + + 'kaihuhang' => !empty($input['kaihuhang'])?$input['kaihuhang']:'', + + 'suoshuzhihang' => !empty($input['suoshuzhihang'])?$input['suoshuzhihang']:'', + + 'yinhangkahao' => !empty($input['yinhangkahao'])?$input['yinhangkahao']:'', 'apply_transfer' => !empty($input['apply_transfer'])?$input['apply_transfer']:0 ]; @@ -921,6 +930,7 @@ class IndexCoach extends ApiRest */ public function getOrderNum() { + $data = [ 'wait' => $this->order_model->getOrderNum([['uniacid', '=', $this->_uniacid], ['coach_id', '=', $this->cap_info['id']], ['pay_type', '=', 2]]), 'start' => $this->order_model->getOrderNum([['uniacid', '=', $this->_uniacid], ['coach_id', '=', $this->cap_info['id']], ['pay_type', 'in', [3, 4, 5]]]), diff --git a/app/massage/controller/IndexUser.php b/app/massage/controller/IndexUser.php index 3c1de22b..e13ed271 100644 --- a/app/massage/controller/IndexUser.php +++ b/app/massage/controller/IndexUser.php @@ -115,14 +115,16 @@ class IndexUser extends ApiRest * @功能说明:个人中心 */ public function index(){ - // print_r( $this->getUserId());die; + if(empty($this->getUserId())){ return $this->success([]); } - $data = $this->model->dataInfo(['id'=>$this->getUserId()]); + if(empty($data)){ + $this->errorMsg('need login',401); + } //获取各类角色的审核结果 $data = $this->model->authCheckData($data); //优惠券数 @@ -1303,7 +1305,14 @@ class IndexUser extends ApiRest 'type' => 4, - 'apply_transfer' => !empty($input['apply_transfer'])?$input['apply_transfer']:0 + 'apply_transfer' => !empty($input['apply_transfer'])?$input['apply_transfer']:0, + 'chikaren' => !empty($input['chikaren'])?$input['chikaren']:'', + + 'kaihuhang' => !empty($input['kaihuhang'])?$input['kaihuhang']:'', + + 'suoshuzhihang' => !empty($input['suoshuzhihang'])?$input['suoshuzhihang']:'', + + 'yinhangkahao' => !empty($input['yinhangkahao'])?$input['yinhangkahao']:'', ]; diff --git a/app/massage/model/Coach.php b/app/massage/model/Coach.php index ffb821ab..8c12c5a8 100644 --- a/app/massage/model/Coach.php +++ b/app/massage/model/Coach.php @@ -625,52 +625,58 @@ class Coach extends BaseModel */ public function getCoachLevel($caoch_id, $uniacid) { - + $coach_model = new Coach(); + $config_model = new Config(); $level_model = new CoachLevel(); + - $config = $config_model->dataInfo(['uniacid'=>$uniacid]); - - $level_cycle = $config['level_cycle']; - - $is_current = $config['is_current']; - //时长(分钟) - $time_long = $level_model->getMinTimeLong($caoch_id,$level_cycle,$is_current); - //最低业绩 - $price = $level_model->getMinPrice($caoch_id,$level_cycle,0,$is_current); - //加钟订单 - $add_price = $level_model->getMinPrice($caoch_id,$level_cycle,1,$is_current); - //积分 - $integral = $level_model->getMinIntegral($caoch_id,$level_cycle,$is_current); - //在线时长 - $online_time = $level_model->getCoachOnline($caoch_id,$level_cycle,$is_current); - - $level = $level_model->where(['uniacid' => $uniacid, 'status' => 1])->order('time_long,id desc')->select()->toArray(); - - $coach_level = []; - - $add_balance = $price>0?$add_price/$price*100:0; - - if (!empty($level)) { - - foreach ($level as $key=>$value) { - //时长 - $level_time_long = $key>0? $level[$key-1]['time_long']:0; - - if($time_long>=$level_time_long&&$price>=$value['price']&&$add_balance>=$value['add_balance']&&$integral>=$value['integral']&&$online_time>=$value['online_time']){ - - $coach_level = $value; - - }elseif (empty($coach_level)) { - //都不符合给一个最低都等级 - $coach_level = $value; + $coach = $coach_model->dataInfo(['id'=>$caoch_id]); + if($coach['level']){ + $coach_level = $level_model->dataInfo(['id'=>$coach['level']]); + }else{ + $config = $config_model->dataInfo(['uniacid'=>$uniacid]); + + $level_cycle = $config['level_cycle']; + + $is_current = $config['is_current']; + //时长(分钟) + $time_long = $level_model->getMinTimeLong($caoch_id,$level_cycle,$is_current); + //最低业绩 + $price = $level_model->getMinPrice($caoch_id,$level_cycle,0,$is_current); + //加钟订单 + $add_price = $level_model->getMinPrice($caoch_id,$level_cycle,1,$is_current); + //积分 + $integral = $level_model->getMinIntegral($caoch_id,$level_cycle,$is_current); + //在线时长 + $online_time = $level_model->getCoachOnline($caoch_id,$level_cycle,$is_current); + + $level = $level_model->where(['uniacid' => $uniacid, 'status' => 1])->order('time_long,id desc')->select()->toArray(); + + $coach_level = []; + + $add_balance = $price>0?$add_price/$price*100:0; + + if (!empty($level)) { + + foreach ($level as $key=>$value) { + //时长 + $level_time_long = $key>0? $level[$key-1]['time_long']:0; + + if($time_long>=$level_time_long&&$price>=$value['price']&&$add_balance>=$value['add_balance']&&$integral>=$value['integral']&&$online_time>=$value['online_time']){ + + $coach_level = $value; + + }elseif (empty($coach_level)) { + //都不符合给一个最低都等级 + $coach_level = $value; + } + } - + } - } - return !empty($coach_level)?$coach_level : []; } diff --git a/app/massage/model/Commission.php b/app/massage/model/Commission.php index d4249571..e8bdb5b3 100644 --- a/app/massage/model/Commission.php +++ b/app/massage/model/Commission.php @@ -1413,7 +1413,7 @@ class Commission extends BaseModel public function cashData($order,$type){ $list = $this->commissionData($type); - + foreach ($list as $key=>$value){ $balance = isset($order[$value['parameter']])?$order[$value['parameter']]:0; @@ -1426,8 +1426,9 @@ class Commission extends BaseModel } + $order['admin_cash'] = $order['surplus_cash']; - + return $order; } @@ -1550,7 +1551,7 @@ class Commission extends BaseModel //技师佣金 $order['coach_cash'] = round($balance*$order['true_service_price']/100,2); -// $order['coach_cash'] = $order['coach_cash']>$cash?$cash:$order['coach_cash']; + // $order['coach_cash'] = $order['coach_cash']>$cash?$cash:$order['coach_cash']; $order['surplus_cash'] = $cash - $order['coach_cash']; @@ -2380,4 +2381,4 @@ class Commission extends BaseModel -} +} \ No newline at end of file diff --git a/app/massage/model/Order.php b/app/massage/model/Order.php index 9f68dc63..74937ef6 100644 --- a/app/massage/model/Order.php +++ b/app/massage/model/Order.php @@ -177,7 +177,7 @@ class Order extends BaseModel ->where(function ($query) use ($mapor){ $query->whereOr($mapor); }) - + ->group('a.id') ->order('a.id desc') ->paginate($page) @@ -195,7 +195,7 @@ class Order extends BaseModel } } - + return $data; } @@ -626,6 +626,7 @@ class Order extends BaseModel } //计算佣金 $order = $comm_model->cashData($order,$type); + //转单时候线下技师需要把佣金给到加盟商 if(empty($order['coach_id'])&&!empty($order['admin_id'])){ @@ -695,7 +696,7 @@ class Order extends BaseModel } //计算佣金 $order = $comm_model->cashDataCustom($order); - + //转单时候线下技师需要把佣金给到加盟商 if(empty($order['coach_id'])&&!empty($order['admin_id'])){ @@ -2003,4 +2004,4 @@ class Order extends BaseModel -} +} \ No newline at end of file diff --git a/app/massage/route/route.php b/app/massage/route/route.php index 02be96bd..4787fbc5 100644 --- a/app/massage/route/route.php +++ b/app/massage/route/route.php @@ -301,6 +301,7 @@ Route::group('admin', function () { Route::get('AdminUser/cashList', 'AdminUser/cashList'); Route::post('AdminUser/delUserLabel', 'AdminUser/delUserLabel'); + Route::post('AdminUser/delUser', 'AdminUser/delUser'); Route::post('AdminUser/applyWallet', 'AdminUser/applyWallet'); diff --git a/app/mobilenode/controller/IndexAgentOrder.php b/app/mobilenode/controller/IndexAgentOrder.php index 9f19e051..c0414539 100644 --- a/app/mobilenode/controller/IndexAgentOrder.php +++ b/app/mobilenode/controller/IndexAgentOrder.php @@ -711,7 +711,7 @@ class IndexAgentOrder extends ApiRest public function applyWallet(){ $input = $this->_input; - + if(empty($input['apply_price'])||$input['apply_price']<0.01){ $this->errorMsg('提现费最低一分'); @@ -782,6 +782,15 @@ class IndexAgentOrder extends ApiRest 'text' => !empty($input['text'])?$input['text']:'', 'type' => 3, + + 'chikaren' => !empty($input['chikaren'])?$input['chikaren']:'', + + 'kaihuhang' => !empty($input['kaihuhang'])?$input['kaihuhang']:'', + + 'suoshuzhihang' => !empty($input['suoshuzhihang'])?$input['suoshuzhihang']:'', + + 'yinhangkahao' => !empty($input['yinhangkahao'])?$input['yinhangkahao']:'', + ]; diff --git a/后端UI/src/api/modules/service.js b/后端UI/src/api/modules/service.js index a699db75..7a9e4acd 100644 --- a/后端UI/src/api/modules/service.js +++ b/后端UI/src/api/modules/service.js @@ -28,7 +28,14 @@ export default { cateUpdate (querys) { return post('massage/admin/AdminService/cateUpdate', querys) }, - // 审核服务 + // 删除订单 + orderDelete (querys) { + return post("/massage/admin/AdminOrder/orderdel", querys) + }, + delUser(querys) { + return post("massage/admin/AdminUser/delUser", querys) + }, +// 审核服务 checkStoreGoods (querys) { return post('massage/admin/AdminService/checkStoreGoods', querys) }, diff --git a/后端UI/src/view/custom/list.vue b/后端UI/src/view/custom/list.vue index 74733913..592ee8cf 100644 --- a/后端UI/src/view/custom/list.vue +++ b/后端UI/src/view/custom/list.vue @@ -121,6 +121,14 @@ v-hasPermi="`${$route.name}-helpPayBalanceOrder`" >{{ $t('action.helpPayBalanceOrder') }} + 删除 @@ -373,6 +381,29 @@ export default { } }) }, + + confirmDeluser (id, status) { + this.$confirm(this.$t('tips.confirmDelete'), this.$t('tips.reminder'), { + confirmButtonText: this.$t('action.comfirm'), + cancelButtonText: this.$t('action.cancel'), + type: 'warning' + }).then(() => { + this.updateItemuser(id, status) + }).catch(() => { + + }) + }, + async updateItemuser (id, status) { + this.$api.service.delUser({ id }).then(res => { + if (res.code === 200) { + this.$message.success(this.$t(status === -1 ? 'tips.successDel' : 'tips.successOper')) + this.getTableDataList('', 'list') + } else { + if (status === -1) return + this.getTableDataList('', 'list') + } + }) + }, async toDelLabel (uid, id) { let { code } = await this.$api.custom.delUserLabel({ user_id: uid, label_id: id }) if (code !== 200) return diff --git a/后端UI/src/view/finance/finance/record.vue b/后端UI/src/view/finance/finance/record.vue index df9e44b1..6a16d537 100644 --- a/后端UI/src/view/finance/finance/record.vue +++ b/后端UI/src/view/finance/finance/record.vue @@ -83,6 +83,10 @@ width="150" > + + + +