爵位赠送不送金币
This commit is contained in:
@@ -39,7 +39,7 @@ class Nobility extends BaseCom
|
|||||||
public function buy_nobility(){
|
public function buy_nobility(){
|
||||||
$lid = input('lid', 0);
|
$lid = input('lid', 0);
|
||||||
$uid = input('uid', $this->uid);
|
$uid = input('uid', $this->uid);
|
||||||
$reslut = model('Nobility')->buyNobility($uid,$lid);
|
$reslut = model('Nobility')->buyNobility($uid,$lid,$is_send);
|
||||||
return V($reslut['code'],$reslut['msg'], null);
|
return V($reslut['code'],$reslut['msg'], null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -129,7 +129,7 @@ class Nobility extends Model
|
|||||||
}
|
}
|
||||||
|
|
||||||
//购买爵位
|
//购买爵位
|
||||||
public function buyNobility($user_id,$lid){
|
public function buyNobility($user_id,$lid,$is_send=0){
|
||||||
$nobility_info = db::name('vs_nobility')
|
$nobility_info = db::name('vs_nobility')
|
||||||
->field('lid,name,pay_price,renew_price,pay_coin,day,renew_coin')
|
->field('lid,name,pay_price,renew_price,pay_coin,day,renew_coin')
|
||||||
->where('delete_time', 0)
|
->where('delete_time', 0)
|
||||||
@@ -245,9 +245,11 @@ class Nobility extends Model
|
|||||||
$pay_coin = $nobility_info['pay_coin'] ?? 0;
|
$pay_coin = $nobility_info['pay_coin'] ?? 0;
|
||||||
}
|
}
|
||||||
if($pay_coin > 0){
|
if($pay_coin > 0){
|
||||||
$reslut = model('common/UserWallet')->change_user_money($user_id, $pay_coin, model('common/UserWallet')::MONEYTYPECOIN, model('common/UserWallet')::NOBILITY_PURCHASE_COIN,model('common/UserWallet')::ChangeTypeLable(model('common/UserWallet')::NOBILITY_PURCHASE_COIN));
|
if($is_send != 1){
|
||||||
if (!$reslut) {
|
$reslut = model('common/UserWallet')->change_user_money($user_id, $pay_coin, model('common/UserWallet')::MONEYTYPECOIN, model('common/UserWallet')::NOBILITY_PURCHASE_COIN,model('common/UserWallet')::ChangeTypeLable(model('common/UserWallet')::NOBILITY_PURCHASE_COIN));
|
||||||
return ['code' => 0, 'msg' => '失败', 'data' => null];
|
if (!$reslut) {
|
||||||
|
return ['code' => 0, 'msg' => '失败', 'data' => null];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user