|
@@ -237,57 +237,64 @@ class Lave extends Api
|
|
|
|
|
|
} else $this->error(LaveMonthModel::getErrorInfo());
|
|
|
}
|
|
|
-
|
|
|
- * 签约订单支付
|
|
|
- * @param Request $request
|
|
|
- * @return mixed
|
|
|
- */
|
|
|
- public function paySign(Request $request)
|
|
|
- {
|
|
|
-
|
|
|
- list($uni, $paytype, $from) = UtilService::postMore([
|
|
|
- ['uni', ''],
|
|
|
- ['paytype', '0'],
|
|
|
- ['from', 'weixin']
|
|
|
- ], $request, true);
|
|
|
- if (!$uni) $this->error('参数错误!');
|
|
|
- $order = LaveMonthModel::where('cid', $this->cid)->where('order_id', $uni)->find();
|
|
|
- if (!$order)
|
|
|
- $this->error('订单不存在!');
|
|
|
- if ($order['paid'])
|
|
|
- $this->error('该订单已支付!');
|
|
|
- $order['pay_type'] = $paytype;
|
|
|
- switch ($order['pay_type']) {
|
|
|
- case '0':
|
|
|
- try {
|
|
|
- if ($from == 'routine') {
|
|
|
- $jsConfig = LaveRepository::jsPaySign($this->cid, $order);
|
|
|
- } else if ($from == 'weixinh5') {
|
|
|
- $jsConfig = LaveRepository::h5PaySign($this->cid, $order);
|
|
|
- } else {
|
|
|
- $jsConfig = LaveRepository::wxPaySign($this->cid, $order);
|
|
|
- }
|
|
|
- } catch (\Exception $e) {
|
|
|
- $this->error($e->getMessage());
|
|
|
- }
|
|
|
- $this->success('获取成功', $jsConfig);
|
|
|
- break;
|
|
|
- }
|
|
|
- return $this->error('支付方式错误');
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
|
|
|
public function payPap(Request $request)
|
|
|
{
|
|
|
- @file_put_contents("quanju.txt", "测试申请扣款-\r\n", 8);
|
|
|
- die();
|
|
|
+
|
|
|
+
|
|
|
$list=WechatPlanRecord::where('is_signing',0)->select();
|
|
|
$cid=$this->cid;
|
|
|
-
|
|
|
$arr=[];
|
|
|
-
|
|
|
$arr['body']='月捐款';
|
|
|
-
|
|
|
foreach ($list as $k => $v){
|
|
|
+ $day = intval(date('d', $v['create_time']));
|
|
|
+
|
|
|
+ $today = intval(date('d'));
|
|
|
+ var_dump($day);
|
|
|
+ var_dump($today);
|
|
|
+
|
|
|
+ if ($day ==1||$today == $day-1){
|
|
|
+ var_dump(123);
|
|
|
+ }
|
|
|
+ die();
|
|
|
$cid=$v['cid'];
|
|
|
|
|
|
$arr['mch_id'] =Company::where('id', $cid)->value('pay_weixin_mchid');
|
|
@@ -296,11 +303,11 @@ class Lave extends Api
|
|
|
|
|
|
$arr['contract_id'] = Company::where('id', $cid)->value('contract_id');
|
|
|
|
|
|
- $rs = WechatService::papPayApply($arr['out_trade_no'], $arr['total_fee'], "lave", '月捐款', 'PAP', [], $cid,$arr['mch_id'],$arr['contract_id']);
|
|
|
+
|
|
|
$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']='';
|
|
@@ -312,6 +319,9 @@ class Lave extends Api
|
|
|
|
|
|
$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']);
|
|
|
}
|
|
|
}
|
|
|
|