sth
This commit is contained in:
parent
9796c6ba53
commit
5bce8cf36c
|
|
@ -243,8 +243,8 @@ class Dispatch2 extends Backend
|
|||
|
||||
$params['status'] = OrderDispatch::STATUS_FINISH;
|
||||
$params['finish_time'] = date('Y-m-d H:i:s');
|
||||
$params['follow'] = 2;
|
||||
$result = $row->allowField(true)->save($params);
|
||||
|
||||
//修改订单状态
|
||||
$OrderLogic = new OrderLogic();
|
||||
$OrderLogic -> dispachFinishAfter($row,['role'=>1,'auth'=>$this->auth,'remark'=>'后台操作完成任务,操作人:'.$this->auth->nickname]);
|
||||
|
|
|
|||
|
|
@ -55,11 +55,11 @@ class Dispatchrecord extends Backend
|
|||
if(empty($dispatch)){
|
||||
$this->error('没有关联派单');
|
||||
}
|
||||
$list = $this->model->where('dispatch_id',$ids)->order('id','desc')->select();
|
||||
// $list = $this->model->where('dispatch_id',$ids)->order('id','desc')->select();
|
||||
|
||||
$this->assign('dispatch',$dispatch);
|
||||
|
||||
$this->assign('records',$list);
|
||||
// $this->assign('records',$list);
|
||||
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
|
@ -83,8 +83,8 @@ class Dispatchrecord extends Backend
|
|||
}
|
||||
|
||||
$params['admin_id'] = $this->auth->id;
|
||||
|
||||
$result = $this->model->allowField(true)->save($params);
|
||||
OrderDispatch::where('id',$params['dispatch_id'])->where('follow',0)->update(['follow'=>1]);
|
||||
Db::commit();
|
||||
} catch (ValidateException|PDOException|Exception $e) {
|
||||
Db::rollback();
|
||||
|
|
|
|||
|
|
@ -46,6 +46,9 @@ class OrderLogic
|
|||
$orderUpdate = [
|
||||
'status' => Order::STATUS_CHECKING
|
||||
];
|
||||
$orderDispatch->follow = 2;
|
||||
$orderDispatch->save();
|
||||
|
||||
if($orderDispatch->is_receipt == 1){ //要收款,计算确认尾款
|
||||
$offline_amount = $orderDispatch->total;
|
||||
$total = bcadd($order->online_amount,$offline_amount,2);
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
namespace app\common\command;
|
||||
|
||||
use app\admin\model\OrderDispatch;
|
||||
use app\admin\model\OrderDispatchRecord;
|
||||
|
||||
use think\console\Command;
|
||||
|
|
@ -26,12 +27,15 @@ class CheckOrdeRecordCommand extends Command
|
|||
->where('status',0)
|
||||
->chunk(100, function ($list) {
|
||||
$ids = [];
|
||||
$dispatchIds = [];
|
||||
foreach ($list as $item) {
|
||||
//todo...通知逻辑
|
||||
$ids[] = $item->id;
|
||||
$dispatchIds = $item->dispatch_id;
|
||||
//修改状态
|
||||
}
|
||||
OrderDispatchRecord::whereIn('id',$ids)->update(['status'=>1]);
|
||||
OrderDispatch::where('id',$dispatchIds)->where('follow',1)->update(['follow'=>0]);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form','layer'], function ($,
|
|||
}
|
||||
}},
|
||||
|
||||
{field: 'follow', title: __('跟进状态'), searchList: {"0":__('待跟进'),"1":__('已跟进'),"2":__('已结束')}, formatter: Table.api.formatter.normal},
|
||||
|
||||
{field: 'order.source_shop', title: __('Order.source_shop'), operate: 'LIKE'},
|
||||
// {field: 'order.source', title: __('Order.source')},
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user