|
@@ -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
|
|
|
*/
|