75 lines
1.8 KiB
PHP
75 lines
1.8 KiB
PHP
<?php
|
|
|
|
namespace app\admin\command;
|
|
|
|
use app\admin\addresmart\Address;
|
|
use app\admin\controller\AutoDispatchLogic;
|
|
use app\admin\controller\orders\DispatchLogic;
|
|
use app\admin\controller\SendMailLogic;
|
|
use app\admin\model\Order;
|
|
use app\admin\model\OrderDispatch;
|
|
use app\admin\model\OrderReview;
|
|
use app\admin\model\Worker;
|
|
use app\admin\model\WorkerItem;
|
|
use think\Collection;
|
|
use think\console\Command;
|
|
use think\console\Input;
|
|
use think\console\Output;
|
|
use think\Db;
|
|
use think\exception\DbException;
|
|
use think\Hook;
|
|
use think\Lang;
|
|
use think\Model;
|
|
use function Symfony\Component\Clock\now;
|
|
|
|
class Test extends Command
|
|
{
|
|
|
|
|
|
protected function configure()
|
|
{
|
|
$this->setName('test')
|
|
->setDescription('批量生成区域名称的拼音');
|
|
}
|
|
|
|
protected function execute(Input $input, Output $output)
|
|
{
|
|
dd(config('system_id'));
|
|
|
|
$order = Order::where('id',140)->find();
|
|
AutoDispatchLogic::autoDispatch($order);
|
|
|
|
|
|
$hookParams = [
|
|
'dispatch' => (new OrderDispatch())->where('id', 144)->find(),
|
|
'remark' => '系统自动派单给师傅:'. '时间嗯' .'('.'12312'.')',
|
|
];
|
|
|
|
Lang::load(APP_PATH . 'admin/lang/zh-cn/orders/dispatch2.php');
|
|
|
|
$Model = new \app\admin\model\OrderDispatch();
|
|
$statusList = $Model->getStatusList();
|
|
$dispatch = $hookParams['dispatch']; //订单对象
|
|
$remark = $hookParams['remark'] ?? ''; //备注
|
|
$data = [
|
|
'dispatch_id' => $dispatch->id,
|
|
'order_id' => $dispatch->order_id,
|
|
'worker_id' => $dispatch->worker_id,
|
|
'status' => $dispatch->status,
|
|
'status_text' => $statusList[$dispatch->status],
|
|
'remark' => $remark,
|
|
'admin_user' => $dispatch->admin_user??'sys',
|
|
];
|
|
dd($data);
|
|
|
|
|
|
dd($res);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|