初始版本

This commit is contained in:
贾祥聪
2025-08-19 14:16:51 +08:00
commit f937a1f9b9
4373 changed files with 359728 additions and 0 deletions

View File

@@ -0,0 +1,250 @@
<?php
namespace app\coachapi\controller;
use app\coachapi\lists\CoachOrderLists;
use app\coachapi\lists\GoodsLists;
use app\coachapi\logic\CoachLogic;
use app\coachapi\validate\CoachValidate;
/**
* 技师控制器类
* Class CoachController
* @package app\coachapi\controller
*/
class CoachController extends BaseCoachController
{
/**
* @notes 个人中心
* @return \think\response\Json
* @author cjhao
* @date 2024/8/23 16:09
*/
public function center()
{
$result = (new CoachLogic())->center($this->coachInfo);
return $this->success('',$result);
}
/**
* @notes 个人中心
* @return \think\response\Json
* @author cjhao
* @date 2024/8/23 16:09
*/
public function info()
{
$result = (new CoachLogic())->info($this->coachId);
return $this->success('',$result);
}
/**
* @notes 技能列表
* @return \think\response\Json
* @author cjhao
* @date 2024/8/20 17:45
*/
public function skillLists()
{
$lists = (new CoachLogic())->skillLists();
return $this->success('',$lists);
}
/**
* @notes 获取服务列表
* @return \think\response\Json
* @author cjhao
* @date 2024/10/13 01:55
*/
public function goodsLists()
{
return $this->dataLists((new GoodsLists()));
}
/**
* @notes 数据列表
* @return \think\response\Json
* @author cjhao
* @date 2024/8/21 18:13
*/
public function otherLists()
{
$dataLists = (new CoachLogic())->otherLists();
return $this->success('',$dataLists);
}
/**
* @notes 申请技师接口
* @return \think\response\Json
* @author cjhao
* @date 2024/8/23 17:19
*/
public function apply()
{
$params = (new CoachValidate())->post()->goCheck('apply',['coach_id'=>$this->coachId]);
$params['coach_id'] = $this->coachId;
$params['coach_user_id'] = $this->coachUserId;
$result = (new CoachLogic())->apply($params);
if(true === $result){
return $this->success('申请成功,请等待平台审核');
}
return $this->fail($result);
}
/**
* @notes 详情
* @return \think\response\Json
* @author cjhao
* @date 2024/8/21 15:29
*/
public function detail()
{
$result = (new CoachLogic())->detail($this->coachUserId);
return $this->success('',$result);
}
/**
* @notes 更新资料
* @return \think\response\Json
* @author cjhao
* @date 2024/8/28 10:05
*/
public function updateInfo()
{
$params = (new CoachValidate())->post()->goCheck('update');
$params['coach_id'] = $this->coachId;
$params['coach_user_id'] = $this->coachUserId;
$result = (new CoachLogic())->updateInfo($params);
if(true === $result){
return $this->success('提交成功,请等待平台审核',[],1,1);
}
return $this->fail($result);
}
/**
* @notes 获取技师资料详情
* @return \think\response\Json
* @author cjhao
* @date 2024/11/26 17:12
*/
public function updateInfoDetail()
{
$result = (new CoachLogic())->updateInfoDetail($this->coachUserId);
return $this->success('',$result);
}
/**
* @notes 更新技师位置
* @return \think\response\Json
* @author cjhao
* @date 2024/8/29 16:00
*/
public function updateLocation()
{
$get = $this->request->get();
if (!isset($get['latitude']) || $get['longitude'] == '') {
return $this->fail('请上传位置');
}
$result = (new CoachLogic())->updateLocation($get,$this->coachId);
if(true === $result){
return $this->success('位置更新成功');
}
return $this->fail($result);
}
/**
* @notes 更新技师状态
* @return \think\response\Json
* @author cjhao
* @date 2024/8/29 16:29
*/
public function updateWorkStatus()
{
(new CoachLogic())->updateWorkStatus($this->coachId);
return $this->success('状态更新成功');
}
/**
* @notes 获取技师服务时间
* @return \think\response\Json
* @author cjhao
* @date 2024/8/29 18:36
*/
public function getServerTime()
{
$result = (new CoachLogic())->getServerTime($this->coachId);
return $this->success('',$result);
}
/**
* @notes 设置技师服务时间
* @return \think\response\Json
* @author cjhao
* @date 2024/9/2 17:28
*/
public function setServerTime()
{
$params = $this->request->post();
$result = (new CoachLogic())->setServerTime($params,$this->coachId);
if(true === $result){
return $this->success('设置成功');
}
return $this->fail($result);
}
/**
* @notes 订单列表
* @return \think\response\Json
* @author cjhao
* @date 2024/9/23 02:25
*/
public function orderLists()
{
return $this->dataLists((new CoachOrderLists()));
}
/**
* @notes 个人资料
* @return \think\response\Json
* @author ljj
* @date 2024/12/3 下午3:52
*/
public function personalData()
{
$result = (new CoachLogic())->personalData($this->coachId);
return $this->success('',$result);
}
/**
* @notes 设置个人资料
* @return \think\response\Json
* @author ljj
* @date 2024/12/3 下午3:57
*/
public function setPersonalData()
{
$params = (new CoachValidate())->post()->goCheck('setPersonalData', ['coach_id' => $this->coachId]);
(new CoachLogic)->setPersonalData($params);
return $this->success('操作成功', [],1,1);
}
/**
* @notes 绑定手机号
* @return \think\response\Json
* @author Tab
* @date 2021/8/25 17:46
*/
public function bindMobile()
{
$params = (new CoachValidate())->post()->goCheck('bindMobile',['coach_id'=>$this->coachId]);
$result = CoachLogic::bindMobile($params);
if($result === true) {
return $this->success('绑定成功', [], 1, 1);
}
return $this->fail($result);
}
}