WIN-2308041133\Administrator 8 months ago
parent
commit
f853792eaf
2 changed files with 24 additions and 23 deletions
  1. 23 22
      application/api/controller/Lave.php
  2. 1 1
      extend/liuniu/WechatService.php

+ 23 - 22
application/api/controller/Lave.php

@@ -345,29 +345,30 @@ class Lave extends Api
                 @file_put_contents("quanju2.txt", "没有上个月的扣款记录-\r\n", 8);
 
 
-//                $cid = $v['cid'];
-//                $mch_id = Company::where('id', $cid)->value('pay_weixin_mchid');
-//                $where1['cid'] = $cid;
-//                $where1['user_id'] = $v['uid'];
-//                $where1['order_name'] = $v['order_name'];
-//                $where1['order_id'] = LaveMonthModel::getNewOrderId();;
-//
-////                $where1['category_id']=$v['category_id'];
-//                $where1['amount'] = $v['price'];
-//                $where1['name'] = $v['contract_display_account'];
-//                $where1['contact'] = '';
-//                $where1['tel'] = $v['tel'];
-//                $where1['address'] = '用户未填写联系地址';
-//                $where1['is_open'] = $v['is_open'];
-//                $where1['is_ticket'] = '0';
-//                $where1['type'] = '0';
-//                $where1['record_id'] = $v['id'];
-//                $where1['contract_code'] = $v['contract_code'];
-//                $where1['plan_id'] = $v['plan_id'];
-//                $where1['nonce_str'] = uniqid();
-//                $order = LaveMonthModel::create($where1);
-//                $rs = WechatService::papPayApply($mch_id, $where1['order_id'], $where1['amount'], "lave", '月捐款', 'PAP', [], $cid, $v['contract_id'], $where1['order_name'], $where1['nonce_str']);
+                $cid = $v['cid'];
+                $mch_id = Company::where('id', $cid)->value('pay_weixin_mchid');
+                $where1['cid'] = $cid;
+                $where1['user_id'] = $v['uid'];
+                $where1['order_name'] = $v['order_name'];
+                $where1['order_id'] = LaveMonthModel::getNewOrderId();;
+
+//                $where1['category_id']=$v['category_id'];
+                $where1['amount'] = $v['price'];
+                $where1['name'] = $v['contract_display_account'];
+                $where1['contact'] = '';
+                $where1['tel'] = $v['tel'];
+                $where1['address'] = '用户未填写联系地址';
+                $where1['is_open'] = $v['is_open'];
+                $where1['is_ticket'] = '0';
+                $where1['type'] = '0';
+                $where1['record_id'] = $v['id'];
+                $where1['contract_code'] = $v['contract_code'];
+                $where1['plan_id'] = $v['plan_id'];
+                $where1['nonce_str'] = uniqid();
+                $order = LaveMonthModel::create($where1);
+                $rs = WechatService::papPayApply($mch_id, $where1['order_id'], $where1['amount'], "lave", '月捐款', 'PAP', [], $cid, $v['contract_id'], $where1['order_name'], $where1['nonce_str']);
 //            }
+                @file_put_contents("quanju2.txt", json_encode($rs)."-补偿月捐汇报\r\n", 8);
             }
         }
         $this->success('获取成功');

+ 1 - 1
extend/liuniu/WechatService.php

@@ -575,7 +575,7 @@ class WechatService
         $order = array_merge(compact('out_trade_no', 'total_fee', 'attach', 'body', 'detail', 'trade_type', 'openid','contract_code','plan_id','spbill_create_ip','contract_display_account'), $options);
         if ($order['detail'] == '') unset($order['detail']);
         $order['contract_notify_url']=Request::instance()->domain() . "/api/wechat/notify/" . $cid;
-        $result = self::payment(false, $cid)->order->unify(
+        $result = self::payment2(false, $cid)->order->unify(
             $order,true
         );
 //        var_dump($result);die();