WIN-2308041133\Administrator 1 vuosi sitten
vanhempi
commit
d7a7373321

+ 27 - 12
application/admin/model/WechatPlanRecord.php

@@ -25,31 +25,46 @@ class WechatPlanRecord extends Model
         } while (self::where(['contract_code' => $orderId])->find());
         return $orderId;
     }
-    public static function plan_lst($where)
+//    public static function plan_lst($where)
+//    {
+//        $model = new self;
+//        $xwhere = null;
+//        $order = "id desc";
+//        if (isset($where['uid']) && $where['uid'] > 0) $xwhere['uid'] = $where['uid'];
+//        if (isset($where['cid']) && $where['cid'] > 0) $xwhere['cid'] = $where['cid'];
+//        $data = $model->where($xwhere)->where('is_signing',0)->order($order)->field('plan_id')->select();
+//        var_dump($data);
+//        $plan=new WechatPlan();
+//        $data2=$plan->where('plan_id','in',['188873'])->select();
+//        var_dump($data2);die();
+////        $count = $plan->where('id','in',$data)->count();
+//        return $data2;
+//    }
+    public static function record_lst($where)
     {
         $model = new self;
         $xwhere = null;
         $order = "id desc";
         if (isset($where['uid']) && $where['uid'] > 0) $xwhere['uid'] = $where['uid'];
         if (isset($where['cid']) && $where['cid'] > 0) $xwhere['cid'] = $where['cid'];
-        $data = $model->where($xwhere)->where('is_signing',0)->order($order)->field('plan_id')->select();
-        var_dump($data);
-        $plan=new WechatPlan();
-        $data2=$plan->where('plan_id','in',['188873'])->select();
-        var_dump($data2);die();
-//        $count = $plan->where('id','in',$data)->count();
-        return $data2;
+        $data = $model->where($xwhere)->where('is_signing',0)->order($order)->select();
+        $count = $model->where($xwhere)->count();
+        return compact('count', 'data');
     }
-    public static function record_lst($where)
+    public static function record_info($where)
     {
         $model = new self;
         $xwhere = null;
         $order = "id desc";
-        if (isset($where['uid']) && $where['uid'] > 0) $xwhere['uid'] = $where['uid'];
-        if (isset($where['cid']) && $where['cid'] > 0) $xwhere['cid'] = $where['cid'];
-        if (isset($where['category_id']) && $where['category_id'] > 0) $xwhere['category_id'] = $where['category_id'];
+        if (isset($where['id']) && $where['id'] > 0) $xwhere['id'] = $where['id'];
+//        if (isset($where['cid']) && $where['cid'] > 0) $xwhere['cid'] = $where['cid'];
+//        if (isset($where['category_id']) && $where['category_id'] > 0) $xwhere['category_id'] = $where['category_id'];
         $data = $model->where($xwhere)->where('is_signing',0)->order($order)->select();
         $count = $model->where($xwhere)->count();
+        @file_put_contents("quanju.txt", json_encode($data)."-列表详情\r\n", 8);
+        var_dump($data['order_name']);die();
+//        $lave = new Lave();
+//        $list = $lave->where('uid', $where['uid'])->where('order_name', $data[0][''])->select();
         return compact('count', 'data');
     }
 }

+ 9 - 10
application/api/controller/Lave.php

@@ -204,6 +204,8 @@ class Lave extends Api
                 'contract_display_account'=>$where1['contract_display_account'],
                 'is_open'=>$where1['is_open'],
                 'tel'=>$where1['tel'],
+                'category_id'=>$where1['category_id'],
+                'order_name'=>$where1['order_name'],
             ];
             $record=WechatPlanRecord::create($plan_record);
             $plan_record['spbill_create_ip']=User::where('id', $where1['user_id'])->value('loginip');
@@ -432,24 +434,21 @@ class Lave extends Api
         );
         if (!isset($where['uid'])) $this->error('用户不存在');
         if (!isset($where['cid'])) $this->error('请选择正确的城市的红十字会');
-        $this->success('获取成功', WechatPlanRecord::plan_lst($where));
+        $this->success('获取成功', WechatPlanRecord::record_lst($where));
     }
-//    签约记录列表
-    public function user_record_lst(Request $request)
+//    签约记录详情
+    public function user_record_info(Request $request)
     {
         $where = UtilService::getMore(
             [
-                ['category_id', 0], //捐款意愿
-                ['cid', 0],
+                ['id', 0],
+//                ['cid', 0],
 //                ['cid', $this->cid],
 //                ['user_id', $this->auth->getUserinfo()['id']],
-                ['user_id', 0],
+//                ['user_id', 0],
             ], $request
         );
-        if (!isset($where['uid'])) $this->error('用户不存在');
-        if (!isset($where['cid'])) $this->error('请选择正确的城市的红十字会');
-        if (!isset($where['category_id'])) $this->error('请选择捐款项目');
-        $this->success('获取成功', WechatPlanRecord::record_lst($where));
+        $this->success('获取成功', WechatPlanRecord::record_info($where));
     }
 }
 

+ 1 - 1
application/route.php

@@ -92,7 +92,7 @@ Route::group('api', function () {
         Route::get('plan_lst', 'api/lave/plan_lst');  //模版列表
         Route::get('plan_info', 'api/lave/plan_read');  //模版列表
         Route::get('user_lst', 'api/lave/user_plan_lst');  //用户签约模版列表
-        Route::get('user_info', 'api/lave/user_record_lst');  //模版列表
+        Route::get('user_info', 'api/lave/user_record_info');  //用户详情详情
     });
     //帮扶
     Route::group('help', function () {

+ 1 - 1
extend/liuniu/WechatService.php

@@ -364,7 +364,7 @@ class WechatService
                     if ($notify['change_type']=='ADD'){
                         $cs=WechatPlanRecord::where('contract_code',$notify['contract_code'])->Update(['contract_id' => $notify['contract_id']]);
                     }elseif ($notify['change_type']=='DELETE'){
-                        $cs=WechatPlanRecord::where('contract_code',$notify['contract_code'])->Update(['is_signing' => 1]);
+                        $cs=WechatPlanRecord::where('contract_code',$notify['contract_code'])->Update(['is_signing' => 1,'deletetime'=>time()]);
                     }
                     @file_put_contents("quanju.txt", $cs."-修改记录\r\n", 8);
                     if (($count = strpos($notify['contract_code'], '_')) !== false) {