فهرست منبع

套餐核销列表和常见问题调整

zhangxiaobin 1 سال پیش
والد
کامیت
5f08a14c3a
2فایلهای تغییر یافته به همراه45 افزوده شده و 2 حذف شده
  1. 44 0
      application/api/controller/Order.php
  2. 1 2
      application/api/controller/Question.php

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

@@ -58,6 +58,50 @@ class Order extends Api
     }
 
     /**
+     * 套餐列表
+     * @return void
+     */
+    public function getPackageList(){
+        try {
+            $status = input('status',0);//状态:1=待使用,2=已核销
+
+            $o = 'order';
+            $st= 'servicetype';
+            $p = 'package';
+
+            $field = $o.'.id,server_info,'.$o.'.servicetype_id,'.$st.'.title as `service_title`,'.$p.'.title as `package_title`,'.
+            $p.'.images as `package_images`,hexiao_time';
+
+            $where[$o.'.user_id'] = $this->auth->id;
+            $where[$o.'.ordertype'] = 3;//类型:1=预约下单,2=在线下单,3=套餐订单
+            $where[$o.'.status'] = ['in',[2,3]];//状态:2=待处理,3=已完成,4=已取消
+            if (!empty($status)) {
+                if ($status == 1) {
+                    $where[$o.'.hexiao_time'] = 0;
+                }
+                if ($status == 2) {
+                    $where[$o.'.hexiao_time'] = ['gt',0];
+                }
+            }
+            $result = $this->model->alias($o)->field($field)
+                ->join($st,$st.'.id = '.$o.'.servicetype_id','LEFT')
+                ->join($p,$p.'.id = '.$o.'.package_id','LEFT')
+                ->where($where)->order($o.'.createtime desc')->autopage()->select();
+            if (!empty($result)) {
+                foreach ($result as $key => &$value) {
+                    $value['package_images'] = !empty($value['package_images']) ? cdnurl($value['package_images']) : '';
+                    $value['is_check'] = !empty($value['hexiao_time']) ? 1 : 0;
+                }
+                $result = list_domain_image($result,['server_images']);
+            }
+
+            $this->success('获取成功', $result);
+        } catch (Exception $e) {
+            $this->error($e->getMessage());
+        }
+    }
+
+    /**
      * 详情
      * @return void
      */

+ 1 - 2
application/api/controller/Question.php

@@ -28,7 +28,7 @@ class Question extends Api
             $field = 'id,title,desc';
             $where['status'] = 1;
             $result = $this->model->field($field)->with(['questionItem'=>function($query){
-                $query->field('id,title,content')->where(['status'=>1]);
+                $query->field('id,title')->where(['status'=>1]);
             }])->where($where)->select();
             $rows = [];
             if (!empty($result)) {
@@ -39,7 +39,6 @@ class Question extends Api
                         $questionItem[] = [
                             'id' => $itemVal['id'],
                             'title' => $itemVal['title'],
-                            'content' => $itemVal['content'],
                         ];
                     }
                     $rows[] = [