소스 검색

计划任务,批量操作无权限

lizhen_gitee 10 달 전
부모
커밋
17541d6a2f
2개의 변경된 파일13개의 추가작업 그리고 4개의 파일을 삭제
  1. 1 0
      application/admin/controller/Doctorinfo.php
  2. 12 4
      application/index/controller/Plantask.php

+ 1 - 0
application/admin/controller/Doctorinfo.php

@@ -22,6 +22,7 @@ class Doctorinfo extends Backend
     {
         parent::_initialize();
         $this->model = new \app\admin\model\Doctorinfo;
+        $this->multiFields = ['typing_switch','video_switch','notice_switch'];
 
     }
 

+ 12 - 4
application/index/controller/Plantask.php

@@ -15,12 +15,14 @@ class Plantask extends Controller
         $lasttime = $nowtime - $second;
 
         //dump(datetime($lasttime));exit;
-        Db::name('wenzhen_order')->where('status',0)->where('createtime','lt',$lasttime)->update([
+        $rs = Db::name('wenzhen_order')->where('status',0)->where('createtime','lt',$lasttime)->update([
             'status'        => 3,
             'cancel_time'   => $nowtime,
             'cancel_reason' => '超时未支付',
             'finish_time'   => $nowtime,
         ]);
+        echo $rs;
+
     }
 
     //待接诊订单,医生不操作,支付N分钟后,自动退珍
@@ -30,7 +32,7 @@ class Plantask extends Controller
         $lasttime = $nowtime - $second;
 
         //dump(datetime($lasttime));exit;
-        Db::name('wenzhen_order')->where('status',10)->where('pay_time','lt',$lasttime)->update([
+        $rs = Db::name('wenzhen_order')->where('status',10)->where('pay_time','lt',$lasttime)->update([
             'status'        => 16,
             'cancel_time'   => $nowtime,
             'cancel_reason' => '超时未接诊',
@@ -39,6 +41,8 @@ class Plantask extends Controller
             'refund_status'   => 1,
         ]);
 
+        echo $rs;
+
         //不仅改状态,还要自动退款,放到队列处理
     }
 
@@ -48,10 +52,12 @@ class Plantask extends Controller
         $second   = config('site.firstvideo_videoorder_autofinish_minute') * 60;
         $lasttime = $nowtime - $second;
 
-        Db::name('wenzhen_order')->where('status',25)->where('ordertype',2)->where('video_time','lt',$lasttime)->update([
+        $rs = Db::name('wenzhen_order')->where('status',25)->where('ordertype',2)->where('video_time','lt',$lasttime)->update([
             'status'        => 30,
             'finish_time'   => $nowtime,
         ]);
+
+        echo $rs;
     }
 
     //图文订单,已接诊,接诊N分钟后,自动结束
@@ -60,10 +66,12 @@ class Plantask extends Controller
         $second   = config('site.accept_textorder_autofinish_minute') * 60;
         $lasttime = $nowtime - $second;
 
-        Db::name('wenzhen_order')->where('status',20)->where('ordertype',1)->where('accept_time','lt',$lasttime)->update([
+        $rs = Db::name('wenzhen_order')->where('status',20)->where('ordertype',1)->where('accept_time','lt',$lasttime)->update([
             'status'        => 30,
             'finish_time'   => $nowtime,
         ]);
+
+        echo $rs;
     }
 
 /////////////////////////////////////////////////////////////////////////