|
@@ -207,7 +207,7 @@ class Lave extends Api
|
|
|
'cid'=>$where['cid'],
|
|
|
'uid'=>$where['user_id'],
|
|
|
'price'=>$where['amount'],
|
|
|
- 'is_signing'=>0,
|
|
|
+ 'is_signing'=>-1,
|
|
|
'contract_code'=>$where1['contract_code'],
|
|
|
'contract_display_account'=>$where1['contract_display_account'],
|
|
|
'is_open'=>$where1['is_open'],
|
|
@@ -245,44 +245,6 @@ class Lave extends Api
|
|
|
|
|
|
} else $this->error(LaveMonthModel::getErrorInfo());
|
|
|
}
|
|
|
-// /**
|
|
|
-// * 签约订单支付
|
|
|
-// * @param Request $request
|
|
|
-// * @return mixed
|
|
|
-// */
|
|
|
-// public function paySign(Request $request)
|
|
|
-// {
|
|
|
-//// var_dump(456);die();
|
|
|
-// 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)
|
|
|
{
|
|
@@ -300,12 +262,6 @@ class Lave extends Api
|
|
|
// @file_put_contents("quanju.txt", $day."-日期\r\n", 8);
|
|
|
$today = intval(date('d'));
|
|
|
$now_date = date('Y-m', time());
|
|
|
-// var_dump($day);
|
|
|
-// var_dump($today);
|
|
|
-// var_dump($last);
|
|
|
-// var_dump($date);
|
|
|
-// var_dump($now_date);
|
|
|
-// var_dump(123);
|
|
|
$tf=false;
|
|
|
if($day==1&&$today==$last){ //签约时间是第一天,且今天是这个月的最后一天
|
|
|
$tf=true;
|
|
@@ -318,12 +274,6 @@ class Lave extends Api
|
|
|
if ($today == $day-1||$tf) { //再确定是不是今天是不是签约日期的前一天
|
|
|
// var_dump(789456132);die();
|
|
|
$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['total_fee'] = $v['price'];
|
|
|
-// $arr['trade_type'] = 'PAP';
|
|
|
-// $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);
|
|
|
$mch_id =Company::where('id',$cid)->value('pay_weixin_mchid');
|
|
|
$where1['cid']=$cid;
|
|
|
$where1['user_id']=$v['uid'];
|
|
@@ -381,7 +331,7 @@ class Lave extends Api
|
|
|
$contract_code=$sign_info['contract_code'];
|
|
|
// $mch_id,$contract_code,$pan_id,$version='1.0',$options=[],$cid=0)
|
|
|
$rs=WechatService::deleteSign($mch_id,$contract_code,$plan_id,'1.0',[],$where['cid']);
|
|
|
- @file_put_contents("quanju.txt", json_encode($rs)."-解除签约返回结果\r\n", 8);
|
|
|
+// @file_put_contents("quanju.txt", json_encode($rs)."-解除签约返回结果\r\n", 8);
|
|
|
$this->success('解除签约成功!');
|
|
|
// if ($rs){
|
|
|
// WechatPlanRecord::where('cid', $where['cid'])->where('uid', $where['user_id'])->where('is_signing',0)->update(['is_signing'=>1]);
|
|
@@ -390,36 +340,6 @@ class Lave extends Api
|
|
|
// $this->error('解除签约失败!');
|
|
|
// }
|
|
|
}
|
|
|
-// 查询签约状态
|
|
|
-// public function querySign(int $cid,int $uid,int $plan_id,string $contract_code)
|
|
|
-// {
|
|
|
-//// $where = UtilService::postMore(
|
|
|
-//// [
|
|
|
-//// ['cid', $this->cid],
|
|
|
-//// ['user_id', $this->auth->getUserinfo()['id']],
|
|
|
-//// ], $request
|
|
|
-//// );
|
|
|
-// $sign_info = WechatPlanRecord::where('cid', $cid)->where('uid', $uid)->where('is_signing', 1)->find();
|
|
|
-// if (!$sign_info) {
|
|
|
-// $this->error('未找到签约信息!');
|
|
|
-// }
|
|
|
-// $mch_id = Company::where('id', $cid)->value('pay_weixin_mchid');
|
|
|
-//// $plan_id = $sign_info['plan_id'];
|
|
|
-//// $contract_code = $sign_info['contract_code'];
|
|
|
-// $rs = WechatService::querySign($mch_id, $contract_code, $plan_id);
|
|
|
-// @file_put_contents("quanju.txt", json_encode($rs) . "-查询签约状态返回结果\r\n", 8);
|
|
|
-// if ($rs['return_code'] == 'SUCCESS') {
|
|
|
-// if ($rs['contract_state'] == 1) {
|
|
|
-// WechatPlanRecord::where('cid',$cid)->where('uid', $uid)->where('is_signing', 1)->update(['is_signing' => 0]);
|
|
|
-// return false;
|
|
|
-// }else{
|
|
|
-// WechatPlanRecord::where('cid',$cid)->where('uid', $uid)->where('is_signing', 1)->update(['contract_id' => $rs['contract_id']]);
|
|
|
-// return true;
|
|
|
-// }
|
|
|
-// } else {
|
|
|
-// $this->error('查询签约状态失败!');
|
|
|
-// }
|
|
|
-// }
|
|
|
public function plan_lst(Request $request)
|
|
|
{
|
|
|
$where = UtilService::getMore(
|