- 按 docs/renew-code-comment.md 将 PHP 文件头改为带边框的 Author 注释\n- 注释中的 crmeb.com 替换为 uj345.cn(代码字符串中的外链未改)\n- 新增 docs/renew-code-comment.md 说明 Made-with: Cursor
78 lines
2.1 KiB
PHP
78 lines
2.1 KiB
PHP
<?php
|
|
// +----------------------------------------------------------------------
|
|
// | Author: ScottPan Team
|
|
// +----------------------------------------------------------------------
|
|
|
|
namespace app\controller\admin\v1\supplier;
|
|
|
|
use think\annotation\Inject;
|
|
use app\controller\admin\AuthController;
|
|
use app\services\order\StoreOrderServices;
|
|
use app\common\controller\Order as CommonOrder;
|
|
use app\services\order\supplier\SupplierOrderServices;
|
|
|
|
/**
|
|
* Class StoreOrder
|
|
* @package app\controller\admin\v1\supplier
|
|
*/
|
|
class StoreOrder extends AuthController
|
|
{
|
|
use CommonOrder;
|
|
|
|
/**
|
|
* @var StoreOrderServices
|
|
*/
|
|
#[Inject]
|
|
protected StoreOrderServices $services;
|
|
|
|
/**
|
|
* 订单列表
|
|
* @return mixed
|
|
* @throws \think\db\exception\DataNotFoundException
|
|
* @throws \think\db\exception\DbException
|
|
* @throws \think\db\exception\ModelNotFoundException
|
|
*/
|
|
public function index()
|
|
{
|
|
$where = $this->request->getMore([
|
|
['status', ''],
|
|
['real_name', ''],
|
|
['is_del', ''],
|
|
['data', '', '', 'time'],
|
|
['type', ''],
|
|
['pay_type', ''],
|
|
['order', ''],
|
|
['field_key', ''],
|
|
['supplier_id', '']
|
|
]);
|
|
|
|
if ($where['supplier_id'] < 1) {
|
|
$where['supplier_id'] = -1;
|
|
}
|
|
$where['type'] = trim($where['type']);
|
|
$where['is_system_del'] = 0;
|
|
|
|
$where['store_id'] = 0;
|
|
$where['type'] = trim($where['type'], ' ');
|
|
return $this->success($this->services->getOrderList($where, ['*'], ['split' => function ($query) {
|
|
$query->field('id,pid');
|
|
}, 'pink', 'invoice', 'supplier']));
|
|
}
|
|
|
|
/**
|
|
* 提醒发货
|
|
* @param $id
|
|
* @return mixed
|
|
*/
|
|
public function deliverRemind(int $supplierId, int $id)
|
|
{
|
|
if (!$supplierId || !$id) return $this->fail('参数异常');
|
|
|
|
/** @var SupplierOrderServices $supplierOrderServices */
|
|
$supplierOrderServices = app()->make(SupplierOrderServices::class);
|
|
$supplierOrderServices->deliverRemind($supplierId, $id);
|
|
return $this->success('提醒成功');
|
|
}
|
|
|
|
}
|