This commit is contained in:
严猪猪 2021-12-23 11:56:41 +08:00
parent ca367c4063
commit f23ea06711
13 changed files with 8 additions and 5 deletions

0
application/admin/controller/AccountLogController.php Normal file → Executable file
View File

0
application/admin/controller/ShopConfigController.php Normal file → Executable file
View File

0
application/admin/controller/WithdrawController.php Normal file → Executable file
View File

0
application/admin/view/account_log/integrallist.html Normal file → Executable file
View File

0
application/admin/view/shop_config/shouyi.html Normal file → Executable file
View File

0
application/admin/view/withdraw/lists.html Normal file → Executable file
View File

View File

@ -248,7 +248,7 @@ class UserController extends Controller
} }
//用户中心 //用户中心
public function userhome(Request $request,User $umodel,WithdrawAccount $wamodel) public function userhome(Request $request,User $umodel,WithdrawAccount $wamodel,Order $omodel)
{ {
$param = $request->param(); $param = $request->param();
$uid = $param['uid']?Crypt::decrypt($param['uid']):''; $uid = $param['uid']?Crypt::decrypt($param['uid']):'';
@ -364,19 +364,22 @@ class UserController extends Controller
if(!$account_info){ if(!$account_info){
return client_error('请选择提现账户'); return client_error('请选择提现账户');
} }
if(!$integral<=0){
return client_error('请输入提现金额');
}
$umodel_info=$umodel->field('integral')->where(array('id'=>$uid))->find(); $umodel_info=$umodel->field('integral')->where(array('id'=>$uid))->find();
if($umodel_info['integral']<$integral){ if($umodel_info['integral']<$integral){
return client_error('积分不足,无法提现'); return client_error('您的积分不足,无法提交申请');
} }
$min_withdraw =ShopConfig::get('withdraw', 'min_withdraw');//最低提现 $min_withdraw =ShopConfig::get('withdraw', 'min_withdraw');//最低提现
$max_withdraw =ShopConfig::get('withdraw', 'max_withdraw');//最高提现积分 $max_withdraw =ShopConfig::get('withdraw', 'max_withdraw');//最高提现积分
$poundage_type =ShopConfig::get('withdraw', 'poundage_type');//手续费类型 1固定 2比例 $poundage_type =ShopConfig::get('withdraw', 'poundage_type');//手续费类型 1固定 2比例
$poundage =ShopConfig::get('withdraw', 'poundage');//手续费 $poundage =ShopConfig::get('withdraw', 'poundage');//手续费
if($integral<$min_withdraw){ if($integral<$min_withdraw){
return client_error('最少提现积分数'.$min_withdraw.',无法提现'); return client_error('提交提现申请失败,请联系客服咨询');
} }
if($integral>$max_withdraw){ if($integral>$max_withdraw){
return client_error('最多提现积分数'.$max_withdraw.',无法提现'); return client_error('提交提现申请失败,请联系客服咨询');
} }
if($poundage_type==2){ if($poundage_type==2){
$poundage=$integral*($poundage/100); $poundage=$integral*($poundage/100);
@ -421,7 +424,7 @@ class UserController extends Controller
}catch(\Exception $e){ }catch(\Exception $e){
// 回滚事务 // 回滚事务
$waymodel->rollback(); $waymodel->rollback();
return client_error($e->getMessage()); return client_error('提交提现申请失败,请联系客服咨询');
} }
return success('','提交提现申请成功,等待审核打款'); return success('','提交提现申请成功,等待审核打款');
} }

0
application/common/model/AccountLog.php Normal file → Executable file
View File

0
application/common/model/ShopConfig.php Normal file → Executable file
View File

0
application/common/model/WithdrawApply.php Normal file → Executable file
View File

0
application/common/validate/AccountLogValidate.php Normal file → Executable file
View File

0
application/common/validate/ShopConfigValidate.php Normal file → Executable file
View File

0
application/common/validate/WithdrawApplyValidate.php Normal file → Executable file
View File