wangsaitao hai 8 meses
pai
achega
e0563d5158

+ 20 - 0
application/admin/controller/Orders.php

@@ -2168,5 +2168,25 @@ class Orders extends Auth {
         }
 
     }
+    public function getTime(){
+        $type = input('type');
+        $start = input('start');
+        $v = Db::name('convey_cate')
+            ->where('id',$type)
+            ->where('enable',1)
+            ->where('del',0)
+            ->find();
+        if($v['time_id'] > 0){
+            $time = Db::name('time')
+                ->where('id',$v['time_id'])
+                ->find();
+            $v['xq_time'] = $start?$start:date('Y-m-d H:i');
+            $v['ywc_time'] = date('Y-m-d H:i',strtotime($v['xq_time']) + 60*$time['bz_time']);
+        }else{
+            $v['xq_time'] = $start?$start:date('Y-m-d H:i');
+            $v['ywc_time'] = '';
+        }
+        $this->success('','',$v);
+    }
 
 }

+ 6 - 0
application/admin/view/orders/self_add3.html

@@ -308,6 +308,12 @@
                 $('#device').val(newtype);
             },
             xq_time: function (newtype, oldtype) {
+                var that = this;
+                $.post("{:url('getTime')}",{type:this.type,'start':newtype},function (res){
+                    console.log(res);
+                    that.xq_time = res.data.xq_time;
+                    that.ywc_time = res.data.ywc_time;
+                })
                 $('#xqtime').val(newtype);
             },
             ywc_time: function (newtype, oldtype) {