浏览代码

套餐没有到期这个字段了

lizhen_gitee 1 年之前
父节点
当前提交
21ed8c9480

+ 1 - 4
application/api/controller/Order.php

@@ -134,10 +134,7 @@ class Order extends Api
             if (empty($modelData)) {
                 throw new Exception('未找到相关信息');
             }
-            //验证
-            if ($modelData['package_endtime'] < time()) {
-                //throw new Exception('已过期无法使用');
-            }
+
             $text = 'hexiaoorder_'.$id;
             $logo = '';
             $filRoute = '/uploads/temp/';

+ 1 - 6
application/api/controller/company/Coupon.php

@@ -118,7 +118,7 @@ class Coupon extends Apic
                 'ordertype'  => 3,
                 'status'     => 2, //2=已支付,待处理
             ];
-            $check = Db::name('order')->field('id,server_info as name,package_endtime as endtime,pay_fee as price')->where($map)->find();
+            $check = Db::name('order')->field('id,server_info as name,pay_fee as price')->where($map)->find();
             if(!empty($check)){
                 $check['getfrom'] = '购买';
                 $check['action'] = $action;
@@ -213,11 +213,6 @@ class Coupon extends Apic
             $this->error('不存在的订单');
         }
 
-        if($check['package_endtime'] < time()){
-            Db::rollback();
-            $this->error('该套餐已到期');
-        }
-
 
         $rs = Db::name('order')->where($map)->update(['hexiao_time'=>time()]);
         if($rs === false){

+ 2 - 2
application/api/controller/company/Package.php

@@ -43,7 +43,7 @@ class Package extends Apic
         if($this->auth->type != 1){
             $this->error('只有门店老板才能设置');
         }
-        $field = ['title','info','servicetype_id','images','days','price','oldprice','content','content_images'];
+        $field = ['title','info','servicetype_id','images','price','oldprice','content','content_images'];
         $data = request_post_hub($field);
 
         $data['company_id'] = $this->auth->company_id;
@@ -95,7 +95,7 @@ class Package extends Apic
         }
 
         //
-        $field = ['title','info','servicetype_id','images','days','price','oldprice','content','content_images'];
+        $field = ['title','info','servicetype_id','images','price','oldprice','content','content_images'];
         $data = request_post_hub($field);
         $data['updatetime'] = time();
 

+ 1 - 3
application/common/service/OrderService.php

@@ -179,8 +179,7 @@ class OrderService
             $time = time();
             $packageWhere['id'] = $packageId;
             $package = Db::name('package')->where($packageWhere)->find();
-            $days = isset($package['days']) ? $package['days'] : 0;
-            $packageEndtime = $time + 86400 * $days;
+
             $userWhere['id'] = $userId;
             $user = Db::name('user')->where($userWhere)->find();
             $userCarWhere['id'] = $carId;
@@ -201,7 +200,6 @@ class OrderService
                 'server_info'     => isset($package['info']) ? $package['info'] : '',//套餐内容
                 'server_images'   => isset($package['images']) ? $package['images'] : '',//套餐图片
                 'pay_fee'         => isset($package['price']) ? $package['price'] : 0.00,//套餐价格
-                'package_endtime' => $packageEndtime,//套餐到期时间
                 'status'          => 2,//状态:1=待支付,2=待处理,3=已完成,4=已取消
                 'pay_time'        => $time,
                 'paytype'         => $orderPayType,//支付方式:1=线下,2=余额,3=微信