chore: 添加静态资源文件和版本配置文件
添加大量图片、字体、音频等静态资源文件,包括用户界面图片、模板文件和安装界面素材 添加系统版本配置文件(.version)和常量定义文件(.constant) 更新供应商依赖文件,包括Symfony VarDumper组件和相关许可证文件 添加验证码配置文件(captcha.php)和.gitignore规则
This commit is contained in:
101
app/controller/api/pc/Order.php
Normal file
101
app/controller/api/pc/Order.php
Normal file
@@ -0,0 +1,101 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2016~2026 https://www.crmeb.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: CRMEB Team <admin@crmeb.com>
|
||||
// +----------------------------------------------------------------------
|
||||
namespace app\controller\api\pc;
|
||||
|
||||
use app\Request;
|
||||
use app\services\order\StoreOrderRefundServices;
|
||||
use app\services\order\StoreOrderServices;
|
||||
use app\services\pc\OrderServices;
|
||||
use think\annotation\Inject;
|
||||
|
||||
class Order
|
||||
{
|
||||
|
||||
/**
|
||||
* @var OrderServices
|
||||
*/
|
||||
#[Inject]
|
||||
protected OrderServices $services;
|
||||
|
||||
/**
|
||||
* 轮询订单状态
|
||||
* @param Request $request
|
||||
* @return mixed
|
||||
*/
|
||||
public function checkOrderStatus(Request $request)
|
||||
{
|
||||
[$order_id, $end_time] = $request->getMore([
|
||||
['order_id', ''],
|
||||
['end_time', ''],
|
||||
], true);
|
||||
$data['status'] = $this->services->checkOrderStatus((string)$order_id);
|
||||
$time = $end_time - time();
|
||||
$data['time'] = $time > 0 ? $time : 0;
|
||||
return app('json')->successful($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取订单列表
|
||||
* @param Request $request
|
||||
* @return mixed
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function getOrderList(Request $request)
|
||||
{
|
||||
$where = $request->getMore([
|
||||
['type', '', '', 'status'],
|
||||
['search', '', '', 'real_name'],
|
||||
]);
|
||||
$where['uid'] = $request->uid();
|
||||
$where['is_del'] = 0;
|
||||
$where['is_system_del'] = 0;
|
||||
if (!in_array($where['status'], [-1, -2, -3])) $where['pid'] = 0;
|
||||
return app('json')->successful($this->services->getOrderList($where));
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取退货商品列表
|
||||
* @param StoreOrderCartInfoServices $services
|
||||
* @param $id
|
||||
* @return mixed
|
||||
*/
|
||||
public function refundCartInfoList(Request $request, StoreOrderServices $services)
|
||||
{
|
||||
[$cart_ids, $id] = $request->postMore([
|
||||
['cart_ids', ''],
|
||||
['id', 0],
|
||||
], true);
|
||||
if (!$id) {
|
||||
return app('json')->fail('缺少发货ID');
|
||||
}
|
||||
$cart_id = [];
|
||||
if ($cart_ids) $cart_id[] = ['cart_id' => $cart_ids];
|
||||
return app('json')->success($services->refundCartInfoList((array)$cart_id, (int)$id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 订单列表
|
||||
* @param Request $request
|
||||
* @return mixed
|
||||
*/
|
||||
public function refundList(Request $request, StoreOrderRefundServices $services)
|
||||
{
|
||||
$where = $request->getMore([
|
||||
['refund_type', '', '', 'refundTypes']
|
||||
]);
|
||||
$where['uid'] = $request->uid();
|
||||
$data['list'] = $services->getRefundOrderList($where);
|
||||
$data['count'] = $services->count($where);
|
||||
return app('json')->successful($data);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user