|
@@ -2,6 +2,7 @@
|
|
|
|
|
|
namespace app\admin\controller;
|
|
|
use app\common\model\Config;
|
|
|
+use app\common\util\AppMsg;
|
|
|
use Overtrue\Pinyin\Pinyin;
|
|
|
use think\App;
|
|
|
use think\Db;
|
|
@@ -1080,6 +1081,17 @@ class Orders extends Auth {
|
|
|
->where('todo_mode', 'in', [1, 2, 3])
|
|
|
->count();
|
|
|
$newUser[$key]['nums'] = $nums;
|
|
|
+
|
|
|
+ $newUser[$key]['cur_status'] = 0; // 空闲
|
|
|
+ $nums2 = Db::name('todo')
|
|
|
+ ->where(['to_user_id' => $value['id'], 'work_type_mode' => 3])
|
|
|
+ ->where('todo_mode', 'in', [1, 2])
|
|
|
+ ->count();
|
|
|
+ if($nums2 > 0){
|
|
|
+ $newUser[$key]['cur_status'] = 1; // 任务中
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
$addr = Db::name('order_convey')
|
|
|
->alias('cpr')
|
|
|
->join('todo os', 'cpr.order_id = os.order_id')
|
|
@@ -1108,6 +1120,8 @@ class Orders extends Auth {
|
|
|
$newUser[$key]['sex_name'] = isset($mm->sex[$u])?$mm->sex[$u]:"";
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ $newUser = list_sort_by($newUser,"addr_time", 'desc');
|
|
|
if($this->orgId==3){
|
|
|
// echo "<pre/>";
|
|
|
// print_r($newUser);
|
|
@@ -1283,6 +1297,9 @@ class Orders extends Auth {
|
|
|
$x2 = date('Ymd', strtotime($xqtimes[1]));
|
|
|
$map[] = ['oc.xq_time', '>=', $x1];
|
|
|
$map[] = ['oc.xq_time', '<=', $x2];
|
|
|
+ }else{ // 默认只显示当天的订单
|
|
|
+ $map[] = ['oc.xq_time', '>=', date("Y-m-d")." 00:00:00"];
|
|
|
+ $map[] = ['oc.xq_time', '<=', date("Y-m-d")." 23:59:59"];
|
|
|
}
|
|
|
if ($ywctime) {
|
|
|
$ywctimes = explode(' - ', $ywctime);
|
|
@@ -1324,7 +1341,7 @@ class Orders extends Auth {
|
|
|
->where($map)
|
|
|
->order(['o.order_mode' => 'asc', 'oc.xq_time' => 'desc'])
|
|
|
->select();
|
|
|
- halt($lists);
|
|
|
+// halt($lists);
|
|
|
$newret = [];
|
|
|
$newret1 = [];
|
|
|
$newret2 = [];
|
|
@@ -1361,6 +1378,7 @@ class Orders extends Auth {
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ $v['is_todo'] = $todo?1:0;
|
|
|
$v['real_names'] = implode(',', $users);
|
|
|
$v['confirm_time'] = $confirmtime;
|
|
|
$last = strtotime($v['ywc_time']) - time();
|
|
@@ -1578,6 +1596,18 @@ class Orders extends Auth {
|
|
|
return $this->fetch();
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ public function reminder(){
|
|
|
+ $id = input('id/d',0);
|
|
|
+ $touserids = Db::name('todo')->where('order_id',$id)->where('todo_mode','in',[1,2])->where('del',0)->column('to_user_id');
|
|
|
+ if($touserids){
|
|
|
+ $touserids = array_unique($touserids);
|
|
|
+ send_jpush($touserids,AppMsg::PUSH_CUSTOM,'您有订单需要处理');
|
|
|
+ }
|
|
|
+
|
|
|
+ $this->success('催单成功');
|
|
|
+ }
|
|
|
+
|
|
|
//运送员状态
|
|
|
public function conveystatus($id='') {
|
|
|
if (request()->isAjax()) {
|