WIN-2308041133\Administrator 5 bulan lalu
induk
melakukan
aa2fe2f5c0

+ 35 - 0
application/admin/lang/zh-cn/laveMonth.php

@@ -0,0 +1,35 @@
+<?php
+
+return [
+    'Id'          => '编号',
+    'Cid'         => '企业编号',
+    'User_id'     => '用户编号',
+    'Order_id'    => '订单号',
+    'Order_name'  => '订单名称',
+    'Amount'      => '捐款金额',
+    'Name'        => '捐款单位',
+    'Contact'     => '联系人',
+    'Tel'         => '联系电话',
+    'Address'     => '地址',
+    'Is_open'     => '是否实名公开',
+    'Is_open 0'   => '不公开',
+    'Is_open 1'   => '公开',
+    'Is_ticket'   => '是否索要发票',
+    'Is_ticket 0' => '不开票',
+    'Is_ticket 1' => '开票',
+    'Paid'        => '支付状态',
+    'Paid 0'      => '未支付',
+    'Paid 1'      => '已支付',
+    'Pay_type'    => '支付方式',
+    'Pay_type 0'  => '微信',
+    'Pay_type 1'  => '支付宝',
+    'Pay_type 2'  => '余额',
+    'Pay_type 3'  => '打款',
+    'Pay_type 4'  => '其它',
+    'Createtime'  => '创建时间',
+    'Paytime'     => '支付时间',
+    'Sn'          => '生成证书',
+    'Type'        => '类型',
+    'Type 0'      => '个人',
+    'Type 1'      => '企业'
+];

+ 2 - 2
application/admin/model/WechatPlanRecord.php

@@ -60,10 +60,10 @@ class WechatPlanRecord extends Model
         if (isset($where['cid']) && $where['cid'] > 0) $xwhere['cid'] = $where['cid'];
         if (isset($where['uid']) && $where['uid'] > 0) $xwhere['uid'] = $where['uid'];
 //        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();
+        $data = $model->where($xwhere)->where('is_signing',0)->order($order)->find();
         $count = $model->where($xwhere)->count();
         $laveMonth = new LaveMonth();
-        $list = $laveMonth->where('user_id', $data[0]['uid'])->where('cid',$data[0]['cid'])->where('order_name', $data[0]['order_name'])->select();
+        $list = $laveMonth->where('user_id', $data['uid'])->where('cid',$data['cid'])->where('order_name', $data['order_name'])->select();
         return compact('count', 'data','list');
     }
 }

+ 3 - 1
application/api/controller/Lave.php

@@ -182,7 +182,7 @@ class Lave extends Api
         $plan_id=$where1['plan_id'];
 //        unset($where1['plan_id']);
         $order = LaveMonthModel::create($where1);
-        @file_put_contents("quanju.txt", json_encode($order)."-创建支付订单\r\n", 8);
+
         $where1['contract_code'] = WechatPlanRecord::getNewCode();
         $where1['contract_display_account']=$contract_display_account;
         cache('lave_' . $where['user_id'], '1', 10);
@@ -192,6 +192,8 @@ class Lave extends Api
         $order['plan_id'] = $plan_id;
         if ($orderId) {
             $orderInfo = LaveMonthModel::where('order_id', $orderId)->find();
+            @file_put_contents("quanju.txt", $orderId."-订单id\r\n", 8);
+            @file_put_contents("quanju.txt", json_encode($orderInfo)."-创建支付订单搜索\r\n", 8);
             if (!$orderInfo || !isset($orderInfo['paid'])) $this->error('支付订单不存在!');
             if ($orderInfo['paid']) $this->error('支付已支付!');
 //          创建签约

+ 16 - 0
extend/liuniu/repositories/PaymentRepositories.php

@@ -3,6 +3,7 @@
 namespace liuniu\repositories;
 
 use app\common\model\Lave;
+use app\common\model\LaveMonth;
 use app\common\model\OrderLevel;
 
 class PaymentRepositories
@@ -85,4 +86,19 @@ class PaymentRepositories
             return false;
         }
     }
+    /**
+     * 月捐款支付成功之后
+     * @param string|null $order_id 订单id
+     * @return bool
+     */
+    public static function wechatMonthLave($event)
+    {
+        list($cid, $order_id) = $event;
+        try {
+            if (LaveMonth::where(['cid' => $cid, 'order_id' => $order_id, 'paid' => 1])->find()) return true;
+            return LaveMonth::paySuccess($cid, $order_id);
+        } catch (\Exception $e) {
+            return false;
+        }
+    }
 }