|
|
@@ -199,26 +199,26 @@ class Lave extends Api
|
|
|
@file_put_contents("quanju.txt", $plan_id . "-签约模版编号\r\n", 8);
|
|
|
// unset($where1['plan_id']);
|
|
|
$where1['contract_code'] = WechatPlanRecord::getNewCode();
|
|
|
- if ($where['user_id'] != 6779 && $where['user_id'] != 12125) {
|
|
|
- $order = LaveMonthModel::create($where1);
|
|
|
- if (!$order) $this->error(LaveMonthModel::getErrorInfo());
|
|
|
- $orderId = $order['order_id'];
|
|
|
- $order['plan_id'] = $plan_id;
|
|
|
- } else {
|
|
|
+// if ($where['user_id'] != 6779 && $where['user_id'] != 12125) {
|
|
|
+// $order = LaveMonthModel::create($where1);
|
|
|
+// if (!$order) $this->error(LaveMonthModel::getErrorInfo());
|
|
|
+// $orderId = $order['order_id'];
|
|
|
+// $order['plan_id'] = $plan_id;
|
|
|
+// } else {
|
|
|
$orderId = $where1['order_id'];
|
|
|
- }
|
|
|
+// }
|
|
|
$where1['contract_display_account'] = $where1['name'];
|
|
|
cache('lave_' . $where['user_id'], '1', 10);
|
|
|
|
|
|
$info['contract_code'] =$where1['contract_code'];
|
|
|
if ($orderId) {
|
|
|
- if ($where['user_id'] != 6779 && $where['user_id'] != 12125&&$where['user_id']!=63) {
|
|
|
- $orderInfo = LaveMonthModel::where('order_id', $orderId)->find();
|
|
|
- if (!$orderInfo || !isset($orderInfo['paid'])) {
|
|
|
- $this->error('支付订单不存在!');
|
|
|
- }
|
|
|
- if ($orderInfo['paid']) $this->error('支付已支付!');
|
|
|
- }
|
|
|
+// if ($where['user_id'] != 6779 && $where['user_id'] != 12125&&$where['user_id']!=63) {
|
|
|
+// $orderInfo = LaveMonthModel::where('order_id', $orderId)->find();
|
|
|
+// if (!$orderInfo || !isset($orderInfo['paid'])) {
|
|
|
+// $this->error('支付订单不存在!');
|
|
|
+// }
|
|
|
+// if ($orderInfo['paid']) $this->error('支付已支付!');
|
|
|
+// }
|
|
|
// 创建签约
|
|
|
$plan_record = [
|
|
|
'plan_id' => $plan_id,
|
|
|
@@ -236,9 +236,9 @@ class Lave extends Api
|
|
|
$count = WechatPlanRecord::where('uid', $where1['user_id'])->where('plan_id', $plan_id)->count();
|
|
|
$record = WechatPlanRecord::create($plan_record);
|
|
|
@file_put_contents("quanju.txt", json_encode($record) . "-签约模版记录\r\n", 8);
|
|
|
- if ($where['user_id'] != 6779 && $where['user_id'] != 12125&&$where['user_id']!=63) {
|
|
|
- LaveMonthModel::where('order_id', $orderId)->update(['record_id' => $record['id']]);
|
|
|
- }
|
|
|
+// if ($where['user_id'] != 6779 && $where['user_id'] != 12125&&$where['user_id']!=63) {
|
|
|
+// LaveMonthModel::where('order_id', $orderId)->update(['record_id' => $record['id']]);
|
|
|
+// }
|
|
|
$plan_record['spbill_create_ip'] = User::where('id', $where1['user_id'])->value('loginip');
|
|
|
$plan_record['contract_notify_url'] = Request::instance()->domain() . "/api/wechat/notify/" . $where['cid'];
|
|
|
try {
|
|
|
@@ -248,7 +248,7 @@ class Lave extends Api
|
|
|
$jsConfig = LaveRepository::h5PaySign($this->cid, $orderId, $plan_record);
|
|
|
} else {
|
|
|
@file_put_contents("quanju3.txt", $return_web . "-返回地址3\r\n", 8);
|
|
|
- $jsConfig = LaveRepository::wxPaySign($this->cid, $orderId, $plan_record,$return_web );
|
|
|
+ $jsConfig = LaveRepository::wxPaySign($this->cid, $orderId, $plan_record );
|
|
|
}
|
|
|
} catch (\Exception $e) {
|
|
|
return $this->error($e->getMessage());
|
|
|
@@ -348,9 +348,9 @@ class Lave extends Api
|
|
|
// die();
|
|
|
|
|
|
$plan = WechatPlanRecord::where('contract_code', $contract_code)->find();
|
|
|
- if ($plan['uid'] != 6779 && $plan['uid'] != 12125&&$plan['uid']!=63) {
|
|
|
- return false;
|
|
|
- }
|
|
|
+// if ($plan['uid'] != 6779 && $plan['uid'] != 12125&&$plan['uid']!=63) {
|
|
|
+// return false;
|
|
|
+// }
|
|
|
@file_put_contents("quanju3.txt", $plan['uid'] . "测试申请扣款uid-\r\n", 8);
|
|
|
if (!empty($plan)) {
|
|
|
$cid = $plan['cid'];
|