|
|
@@ -217,6 +217,8 @@ 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);
|
|
|
+ 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 {
|
|
|
@@ -233,10 +235,10 @@ class Lave extends Api
|
|
|
$info['jsConfig'] = $jsConfig;
|
|
|
// 增加参与人数
|
|
|
|
|
|
- @file_put_contents("quanju.txt", $count."-参与次数\r\n", 8);
|
|
|
+// @file_put_contents("quanju.txt", $count."-参与次数\r\n", 8);
|
|
|
if ($count==0){
|
|
|
$num=WechatPlan::where('plan_id', $plan_id)->value('num');
|
|
|
- @file_put_contents("quanju.txt", $num."-参与人数\r\n", 8);
|
|
|
+// @file_put_contents("quanju.txt", $num."-参与人数\r\n", 8);
|
|
|
WechatPlan::where('plan_id', $plan_id)->update(['num' => $num+1]);
|
|
|
}
|
|
|
return $this->success('订单创建成功', $info);
|
|
|
@@ -297,45 +299,47 @@ class Lave extends Api
|
|
|
// @file_put_contents("quanju.txt", $day."-日期\r\n", 8);
|
|
|
$today = intval(date('d'));
|
|
|
$now_date = date('Y-m');
|
|
|
- var_dump($day);
|
|
|
- var_dump($today);
|
|
|
- var_dump($last);
|
|
|
- var_dump($date);
|
|
|
- var_dump($now_date);
|
|
|
+// var_dump($day);
|
|
|
+// var_dump($today);
|
|
|
+// var_dump($last);
|
|
|
+// var_dump($date);
|
|
|
+// var_dump($now_date);
|
|
|
if ($date != $now_date) { //先确定月份不同
|
|
|
if ($today == $day||$today==$last) { //再确定是不是签约那天或者是当月的最后一天
|
|
|
- var_dump(123);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- die();
|
|
|
- $cid=$v['cid'];
|
|
|
+// var_dump(123);
|
|
|
+ $cid=$v['cid'];
|
|
|
// if ($this->querySign($cid,$v['uid'],$v['plan_id'],$v['contract_code'])){
|
|
|
- $arr['mch_id'] =Company::where('id', $cid)->value('pay_weixin_mchid');
|
|
|
- $arr['out_trade_no']=LaveMonthModel::getNewOrderId();
|
|
|
- $arr['total_fee'] = $v['price'];
|
|
|
+ $arr['mch_id'] =Company::where('id', $cid)->value('pay_weixin_mchid');
|
|
|
+ $arr['out_trade_no']=LaveMonthModel::getNewOrderId();
|
|
|
+ $arr['total_fee'] = $v['price'];
|
|
|
// $arr['trade_type'] = 'PAP';
|
|
|
- $arr['contract_id'] = Company::where('id', $cid)->value('contract_id');
|
|
|
+ $arr['contract_id'] = Company::where('id', $cid)->value('contract_id');
|
|
|
// $rs = WechatService::paymentOrder($openid, $orderInfo['order_id'], $orderInfo['amount'], "lave", $orderInfo['order_name'], '', 'JSAPI', [], $cid);
|
|
|
|
|
|
- $where1['cid']=$cid;
|
|
|
- $where1['user_id']=$v['uid'];
|
|
|
- $where1['order_name']=$v['order_name'];
|
|
|
+ $where1['cid']=$cid;
|
|
|
+ $where1['user_id']=$v['uid'];
|
|
|
+ $where1['order_name']=$v['order_name'];
|
|
|
// $where1['category_id']=$v['category_id'];
|
|
|
- $where1['amount']=$arr['total_fee'];
|
|
|
- $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['amount']=$arr['total_fee'];
|
|
|
+ $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['help_id']='0';
|
|
|
- $order = LaveMonthModel::create($where1);
|
|
|
+ $order = LaveMonthModel::create($where1);
|
|
|
// }
|
|
|
- var_dump($order);
|
|
|
- die();
|
|
|
- $rs = WechatService::papPayApply($arr['out_trade_no'], $arr['total_fee'], "lave", '月捐款', 'PAP', [], $cid,$arr['mch_id'],$arr['contract_id']);
|
|
|
+ var_dump($order);
|
|
|
+ die();
|
|
|
+ $rs = WechatService::papPayApply($arr['out_trade_no'], $arr['total_fee'], "lave", '月捐款', 'PAP', [], $cid,$arr['mch_id'],$arr['contract_id']);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+// die();
|
|
|
+
|
|
|
// }
|
|
|
}
|
|
|
// 解除签约
|