WIN-2308041133\Administrator 1 mês atrás
pai
commit
c3b94f4c1a

+ 1 - 0
application/admin/lang/zh-cn/wechat/plan_record.php

@@ -10,6 +10,7 @@ return [
     'Is_open 0'   => '不公开',
     'Is_open 1'   => '公开',
     'Is_signing'     => '是否解约',
+    'Is_signing -1'   => '未支付',
     'Is_signing 0'   => '签约中',
     'Is_signing 1'   => '已解约',
     'Createtime' => '创建时间',

+ 2 - 82
application/api/controller/Lave.php

@@ -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(

+ 1 - 1
extend/liuniu/WechatService.php

@@ -362,7 +362,7 @@ class WechatService
                 if (isset($notify['change_type']) && $notify['change_type']) {
                     @file_put_contents("quanju.txt", $notify['change_type']."-状态\r\n", 8);
                     if ($notify['change_type']=='ADD'){
-                        $cs=WechatPlanRecord::where('contract_code',$notify['contract_code'])->Update(['contract_id' => $notify['contract_id']]);
+                        $cs=WechatPlanRecord::where('contract_code',$notify['contract_code'])->Update(['contract_id' => $notify['contract_id'],'is_signing'=>0]);
                         if (($count = strpos($notify['contract_code'], '_')) !== false) {
                             $notify['contract_code'] = substr($notify['contract_code'], $count + 1);
                         }

+ 1 - 1
public/assets/js/backend/wechat/plan_record.js

@@ -28,7 +28,7 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
                         {field: 'contract_display_account', title: __('contract_display_account')},
                         // {field: 'text', title: __('Text')},
                         {field: 'price', title: __('price')},
-                        {field: 'is_signing', title: __('is_signing'), searchList: {"0":__('is_signing 0'),"1":__('is_signing 1')}, formatter: Table.api.formatter.normal},
+                        {field: 'is_signing', title: __('is_signing'), searchList: {"-1":__('is_signing -1'),"0":__('is_signing 0'),"1":__('is_signing 1')}, formatter: Table.api.formatter.normal},
                         {field: 'createtime', title: __('Create time'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
                         // {field: 'updatetime', title: __('Update time'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
                         // {field: 'status', title: __('Status'), formatter: Table.api.formatter.status},