WIN-2308041133\Administrator 6 miesięcy temu
rodzic
commit
d78229eb69

+ 16 - 0
application/admin/model/WechatPlan.php

@@ -22,4 +22,20 @@ class WechatPlan extends Model
         } while (self::where(['order_id' => $orderId])->find());
         return $orderId;
     }
+    public static function lst($where)
+    {
+        $model = new self;
+        $xwhere = null;
+        $order = "id desc";
+        if (isset($where['cid']) && $where['cid'] > 0) $xwhere['cid'] = $where['cid'];
+        if (isset($where['plan_id']) && $where['plan_id'] > 0) $xwhere['plan_id'] = $where['plan_id'];
+        if (isset($where['price']) && $where['price'] > 0) $xwhere['price'] = $where['price'];
+//        if (isset($where['paid']) && $where['paid'] > -1) $xwhere['paid'] = $where['paid'];
+//        if (isset($where['help_id']) && $where['help_id'] > -1) $xwhere['help_id'] = $where['help_id'];
+//        if (isset($where['order']) && $where['order'] != '') $order = $where['order'];
+//        if (isset($where['key']) && $where['key'] != '') $xwhere['name|contact|tel'] = ['like', "%{$where['key']}%"];
+        $data = $model->where($xwhere)->order($order)->page($where['page'], $where['limit'])->select();
+        $count = $model->where($xwhere)->count();
+        return compact('count', 'data');
+    }
 }

+ 16 - 0
application/api/controller/Lave.php

@@ -164,6 +164,7 @@ class Lave extends Api
                 ['pay_type', '0'],
                 ['type', '0'],
                 ['help_id', 0],
+                ['plan_id', 0],
                 ['from', 'weixin'],
             ], $request
         );
@@ -383,6 +384,21 @@ class Lave extends Api
 //            $this->error('查询签约状态失败!');
 //        }
     }
+    public function plan_lst(Request $request)
+    {
+        $where = UtilService::getMore(
+            [
+                ['page', 1],
+                ['limit', 10],
+                ['cid', $this->cid],
+//                ['paid', 1],
+//                ['category_id', 0],
+//                ['order', ''],
+//                ['key', ''],
+            ], $request
+        );
+        $this->success('获取成功', WechatPlan::lst($where));
+    }
 }
 
 ?>

+ 1 - 0
application/route.php

@@ -89,6 +89,7 @@ Route::group('api', function () {
         Route::get('pay_pap', 'api/lave/payPap');  //申请扣款
         Route::get('query_sign', 'api/lave/querySign');  //查询签约
         Route::get('cs_query_sign', 'api/lave/csquerySign');  //测试查询签约
+        Route::get('plan_lst', 'api/lave/plan_lst');  //模版列表
     });
     //帮扶
     Route::group('help', function () {