初始版本
This commit is contained in:
147
server/app/coachapi/controller/OrderController.php
Executable file
147
server/app/coachapi/controller/OrderController.php
Executable file
@@ -0,0 +1,147 @@
|
||||
<?php
|
||||
namespace app\coachapi\controller;
|
||||
use app\coachapi\lists\IncomeLists;
|
||||
use app\coachapi\logic\OrderLogic;
|
||||
use app\coachapi\validate\OrderValidate;
|
||||
use app\common\logic\PayNotifyLogic;
|
||||
|
||||
/**
|
||||
* 订单控制器类
|
||||
* Class OrderController
|
||||
* @package app\coachapi\controller
|
||||
*/
|
||||
class OrderController extends BaseCoachController
|
||||
{
|
||||
public array $notNeedLogin = ['test'];
|
||||
|
||||
|
||||
/**
|
||||
* @notes 订单列表
|
||||
* @return \think\response\Json
|
||||
* @author cjhao
|
||||
* @date 2024/9/16 21:14
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
return $this->dataLists();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 订单详情
|
||||
* @return \think\response\Json
|
||||
* @author cjhao
|
||||
* @date 2024/9/20 02:18
|
||||
*/
|
||||
public function detail()
|
||||
{
|
||||
$id = $this->request->get('id');
|
||||
$result = (new OrderLogic())->detail($id);
|
||||
return $this->success('', $result);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 接单操作
|
||||
* @return \think\response\Json
|
||||
* @author cjhao
|
||||
* @date 2024/9/13 17:23
|
||||
*/
|
||||
public function take()
|
||||
{
|
||||
$params = (new OrderValidate())->post()->goCheck('',['coach_id'=>$this->coachId]);
|
||||
$result = (new OrderLogic())->take($params);
|
||||
if (true === $result) {
|
||||
return $this->success('接单成功', ['msg'=>'接单成功'], 1, 0);
|
||||
}
|
||||
return $this->success(OrderLogic::getError(), ['msg'=>OrderLogic::getError()], 1, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 出发操作
|
||||
* @return \think\response\Json
|
||||
* @author cjhao
|
||||
* @date 2024/9/13 17:24
|
||||
*/
|
||||
public function depart()
|
||||
{
|
||||
$params = (new OrderValidate())->post()->goCheck('',['coach_id'=>$this->coachId]);
|
||||
$result = (new OrderLogic())->depart($params);
|
||||
if (true === $result) {
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(OrderLogic::getError());
|
||||
}
|
||||
|
||||
/**
|
||||
* @notes 达到操作
|
||||
* @return \think\response\Json
|
||||
* @author cjhao
|
||||
* @date 2024/9/13 17:24
|
||||
*/
|
||||
public function arrive()
|
||||
{
|
||||
$params = (new OrderValidate())->post()->goCheck('',['coach_id'=>$this->coachId]);
|
||||
$result = (new OrderLogic())->arrive($params);
|
||||
if (true === $result) {
|
||||
return $this->success('操作成功', [], 1, 0);
|
||||
}
|
||||
return $this->fail(OrderLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 服务开始
|
||||
* @return \think\response\Json
|
||||
* @author cjhao
|
||||
* @date 2024/9/14 14:47
|
||||
*/
|
||||
public function startServer()
|
||||
{
|
||||
$params = (new OrderValidate())->post()->goCheck('',['coach_id'=>$this->coachId]);
|
||||
$result = (new OrderLogic())->startServer($params);
|
||||
if (true === $result) {
|
||||
return $this->success('操作成功', [], 1, 1);
|
||||
}
|
||||
return $this->fail(OrderLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 服务完成
|
||||
* @return \think\response\Json
|
||||
* @author cjhao
|
||||
* @date 2024/9/14 14:53
|
||||
*/
|
||||
public function finishServer()
|
||||
{
|
||||
$params = (new OrderValidate())->post()->goCheck('',['coach_id'=>$this->coachId]);
|
||||
$result = (new OrderLogic())->finishServer($params);
|
||||
if (true === $result) {
|
||||
return $this->success('操作成功', [], 1, 0);
|
||||
}
|
||||
return $this->fail(OrderLogic::getError());
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @notes 收入列表
|
||||
* @return \think\response\Json
|
||||
* @author cjhao
|
||||
* @date 2024/11/5 18:11
|
||||
*/
|
||||
public function incomeLists()
|
||||
{
|
||||
return $this->dataLists((new IncomeLists()));
|
||||
}
|
||||
|
||||
public function test()
|
||||
{
|
||||
|
||||
// PayNotifyLogic::handle('deposit', 202411290022494214, []);
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user