爵位接口提交-后台-昵称颜色列表显示
This commit is contained in:
@@ -16,7 +16,7 @@ class Decorate extends Model
|
||||
protected $createTime = 'createtime';
|
||||
protected $updateTime = 'updatetime';
|
||||
// 定义字段类型 1头像框 2坐骑 3麦圈 6个人靓号 7房间靓号 8公会靓号
|
||||
public $TypeArray = [1=>'头像框',2=>'坐骑',3=>'麦圈',6=>'个人靓号',7=>'房间靓号',8=>'公会靓号',9=>'聊天气泡'];
|
||||
public $TypeArray = [1=>'头像框',2=>'坐骑',9=>'聊天气泡',6=>'个人靓号',7=>'房间靓号',8=>'公会靓号',3=>'麦圈'];
|
||||
protected $FromType = [1=>'购买',2=>'后台赠送',3=>'礼盒开奖',4=>'好友赠送',5=>'首充赠送',6=>'天降好礼获得',7=>'财富等级特权赠送',8=>'新人充值好礼',9=>'爵位购买赠送'];
|
||||
public function __construct($data = [])
|
||||
{
|
||||
|
||||
@@ -86,7 +86,7 @@ class Nobility extends Model
|
||||
$return['nobility_power_list'] = [];
|
||||
//爵位列表
|
||||
$nobility_list = db::name('vs_nobility')
|
||||
->field('lid,name,power_ids')
|
||||
->field('lid,name,power_ids,nick_name_color')
|
||||
->where('delete_time', 0)
|
||||
->select();
|
||||
//权限列表
|
||||
@@ -94,6 +94,12 @@ class Nobility extends Model
|
||||
->field('id,name,image')
|
||||
->where('delete_time', 0)
|
||||
->select();
|
||||
$power_list_zw = [
|
||||
'id' => 0,
|
||||
'name' => '特权',
|
||||
'image' => '',
|
||||
];
|
||||
array_unshift($power_list, $power_list_zw);
|
||||
foreach ($power_list as $key => $value) {
|
||||
$return['nobility_power_list'][$key] = $value;
|
||||
foreach ($nobility_list as $k => $v) {
|
||||
@@ -104,6 +110,15 @@ class Nobility extends Model
|
||||
}else{
|
||||
$v['status'] = 0; //否
|
||||
}
|
||||
//类型:1 是状态 2是文字
|
||||
if($value['id']==2){
|
||||
$v['type'] = 2;
|
||||
$v['value'] = $v['nick_name_color'] ?? '';
|
||||
}else{
|
||||
$v['type'] = 1;
|
||||
$v['value'] = '';
|
||||
}
|
||||
unset($v['nick_name_color']);
|
||||
$return['nobility_power_list'][$key]['nobility_list'][$k] = $v;
|
||||
}
|
||||
}
|
||||
@@ -201,8 +216,22 @@ class Nobility extends Model
|
||||
->where('delete_time', 0)
|
||||
->where('lid', $lid)
|
||||
->select();
|
||||
foreach ($nobility_decorate as $key => $value) {
|
||||
model('api/Decorate')->pay_decorate($user_id,$value['did'],$value['day'],9);
|
||||
if($nobility_decorate){
|
||||
foreach ($nobility_decorate as $key => $value) {
|
||||
model('api/Decorate')->pay_decorate($user_id,$value['did'],$value['day'],9);
|
||||
}
|
||||
}
|
||||
//发放金币
|
||||
if($is_renew ==0 || $is_renew ==2) {
|
||||
$pay_coin = $nobility_info['pay_coin'];
|
||||
}else{
|
||||
$pay_coin = $nobility_info['renew_coin'];
|
||||
}
|
||||
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 (!$reslut) {
|
||||
return ['code' => 0, 'msg' => '失败'];
|
||||
}
|
||||
}
|
||||
return ['code' => 1, 'msg' => '成功'];
|
||||
}
|
||||
|
||||
@@ -90,6 +90,8 @@ class UserWallet extends Model
|
||||
const RED_PACKET_LEFT_COIN = 33;
|
||||
//红包剩余退回(钻石)
|
||||
const RED_PACKET_LEFT_DIAMOND = 34;
|
||||
//爵位购买赠送金币(金币)
|
||||
const NOBILITY_PURCHASE_COIN = 35;
|
||||
|
||||
//金币支出类型数组
|
||||
public $coin_consumption_type_array = [
|
||||
@@ -162,6 +164,7 @@ class UserWallet extends Model
|
||||
self::RED_PACKET_DIAMOND_RECEIVE => '抢红包(钻石)',
|
||||
self::RED_PACKET_LEFT_COIN => '红包剩余退回(金币)',
|
||||
self::RED_PACKET_LEFT_DIAMOND => '红包剩余退回(钻石)',
|
||||
self::NOBILITY_PURCHASE_COIN => '爵位购买赠送(金币)',
|
||||
];
|
||||
if($type){
|
||||
return $status[$type] ?? '';
|
||||
|
||||
Reference in New Issue
Block a user