Browse Source

订单列表,计划任务

lizhen_gitee 11 months ago
parent
commit
dd64e905ad
2 changed files with 88 additions and 0 deletions
  1. 44 0
      application/api/controller/Wenzhen.php
  2. 44 0
      application/index/controller/Plantask.php

+ 44 - 0
application/api/controller/Wenzhen.php

@@ -160,4 +160,48 @@ class Wenzhen extends Api
             $this->success('success',$res);
         }
     }
+
+    //订单列表
+    public function order_list(){
+        $status = input('status',0);
+
+        $where = [];
+        if(!empty($status)){
+            $where['order.status'] = $status;
+
+            if($status == 30){
+                $where['order.status'] = ['IN',$status];
+            }
+        }
+
+        $field = [
+            'order.id','order.order_no','order.createtime','order.status',
+            'doctor.avatar','doctor.nickname',
+        ];
+        $list = Db::name('wenzhen_order')->alias('order')
+            ->join('')
+
+
+    }
+
+    //订单详情
+    public function order_info(){
+        $order_id = input('order_id',0);
+
+        //订单详情
+        $wenzhen_order = Db::name('wenzhen_order')->where('user_id',$this->auth->id)->where('id',$order_id)->find();
+        if(empty($wenzhen_order)){
+            $this->error('不存在的订单');
+        }
+        $wenzhen_order = info_domain_image($wenzhen_order,['feedback_images']);
+
+        //就诊人详情
+        $order_member_info = Db::name('wenzhen_order_member')->where('order_id',$order_id)->find();
+        $order_member_info = info_domain_image($order_member_info,['member_images']);
+        $order_member_info['age'] = birthtime_to_age($order_member_info['birthday']);
+
+        $wenzhen_order['member_info'] = $order_member_info;
+
+        $this->success(1,$wenzhen_order);
+    }
 }

+ 44 - 0
application/index/controller/Plantask.php

@@ -0,0 +1,44 @@
+<?php
+
+namespace app\index\controller;
+
+use think\Controller;
+use think\Db;
+use think\Cache;
+
+class Plantask extends Controller
+{
+    //超时未支付订单,自动取消
+    public function auto_cancel_nopay_order(){
+
+    }
+
+    //超时未接诊订单,自动取消,并退款
+    public function aoto_cancel_noaccept_order(){
+
+    }
+
+/////////////////////////////////////////////////////////////////////////
+
+    //定时跑用户活跃,改成离线
+    public function auto_user_active(){
+        $actitime = time() - 7200;
+
+        $sql = 'update `mt_user` set is_active = 0 where is_active = 1 and id in (select user_id from mt_user_active where requesttime < '.$actitime.')';
+        db()->query($sql);
+    }
+
+    //vip过期的,三个隐私设置改成0
+    //vip过期的,更新用户表is_vip
+    public function auto_vipend(){
+//        $sql = 'update `mt_user_power` set yinsi = 0,yinshen = 0,wuhen = 0 where user_id in (select user_id from mt_user_wallet where vip_endtime > 0 and vip_endtime < '.time().')';
+//        db()->query($sql);
+
+        /*$sql2 = 'update `mt_user` set is_vip = 0 where is_vip = 1 and user_id in (select user_id from mt_user_wallet where vip_endtime > 0 and vip_endtime < '.time().')';
+        db()->query($sql2);*/
+    }
+
+
+
+
+}