This commit is contained in:
parent
ca367c4063
commit
f23ea06711
|
|
@ -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('','提交提现申请成功,等待审核打款');
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue