Browse Source

银行卡需要验证码,操作余额需要老板

lizhen_gitee 1 year ago
parent
commit
f06875a857

+ 5 - 1
application/api/controller/company/Customer.php

@@ -237,6 +237,10 @@ class Customer extends Apic
         $number  = $type == 1 ? $money : -$money;
         $logtype = $type == 1 ? 101 : 102;
 
+        //验证
+        if($this->auth->type != 1){
+            $this->error('只有门店老板才能操作');
+        }
 
         //检查
         $map = [
@@ -250,7 +254,7 @@ class Customer extends Apic
         }
 
         Db::startTrans();
-        $rs = model('wallet')->lockChangeAccountRemain($this->auth->company_id,$user_id,'money',$number,$logtype,$remark='门店操作余额');
+        $rs = model('wallet')->lockChangeAccountRemain($this->auth->company_id,$user_id,'money',$number,$logtype,$this->auth->mobile.'门店操作余额');
         if($rs['status'] === false){
             Db::rollback();
             $this->error($rs['msg']);

+ 25 - 1
application/api/controller/company/Userbank.php

@@ -4,7 +4,7 @@ namespace app\api\controller\company;
 
 use app\common\controller\Apic;
 use think\Db;
-
+use app\common\library\Sms;
 /**
  * 银行卡
  */
@@ -21,6 +21,18 @@ class Userbank extends Apic
 
     //提现账号添加
     public function bankadd() {
+
+        //验证
+        if($this->auth->type != 1){
+            $this->error('只有门店老板才能设置银行卡');
+        }
+        //验证手机和验证码
+        $captcha    = input('captcha', '', 'trim'); //账户真实姓名
+        if (!Sms::check($this->auth->mobile, $captcha, 'mobilelogin')) {
+            $this->error('验证码错误');
+        }
+
+        //
         $bank_account    = input('bank_account', '', 'trim'); //账户真实姓名
         $bank_card       = input('bank_card', '', 'trim'); //卡号或账号
         $bank_name       = input('bank_name', '', 'trim'); //银行名称
@@ -62,6 +74,18 @@ class Userbank extends Apic
 
     //提现账号编辑
     public function bankedit(){
+
+        //验证
+        if($this->auth->type != 1){
+            $this->error('只有门店老板才能设置银行卡');
+        }
+        //验证手机和验证码
+        $captcha    = input('captcha', '', 'trim'); //账户真实姓名
+        if (!Sms::check($this->auth->mobile, $captcha, 'mobilelogin')) {
+            $this->error('验证码错误');
+        }
+
+        //
         $id = input('id', 0, 'intval'); //账号id
         $bank_account    = input('bank_account', '', 'trim'); //账户真实姓名
         $bank_card       = input('bank_card', '', 'trim'); //卡号或账号