房间热度卡开发-调试
This commit is contained in:
@@ -20,6 +20,8 @@ class Decorate extends Model
|
||||
// 定义字段类型 1头像框 2坐骑 3麦圈 6个人靓号 7房间靓号 8公会靓号
|
||||
public $TypeArray = [1=>'头像框',12=>'降身卡',2=>'坐骑',9=>'聊天气泡',6=>'个人靓号',7=>'房间靓号',8=>'公会靓号',3=>'麦圈',10=>'CP特效',11=>'CP装扮',13=>"房间热度卡"];
|
||||
protected $FromType = [1=>'购买',2=>'后台赠送',3=>'礼盒开奖',4=>'好友赠送',5=>'首充赠送',6=>'天降好礼获得',7=>'财富等级特权赠送',8=>'新人充值好礼',9=>'爵位购买赠送',10=>'任务奖励',11=>"每日签到"];
|
||||
//特殊装扮(卡片类型 可直接购买 不用配置天数价格)
|
||||
public $SpecialType = [12=>'降身卡',13=>'房间热度卡'];
|
||||
public function __construct($data = [])
|
||||
{
|
||||
parent::__construct($data);
|
||||
@@ -82,7 +84,7 @@ class Decorate extends Model
|
||||
'a.type' => $type,
|
||||
];
|
||||
}
|
||||
if(in_array($type, [12,13])){
|
||||
if(in_array($type, array_keys($this->SpecialType))){
|
||||
$map = [
|
||||
'type' => $type,
|
||||
'delete_time' => 0,
|
||||
@@ -119,7 +121,7 @@ class Decorate extends Model
|
||||
if (!$decorate) {
|
||||
return ['code' => 0, 'msg' => '参数错误'];
|
||||
}
|
||||
if(in_array($decorate['type'], [12,13])){
|
||||
if(in_array($decorate['type'], array_keys($this->SpecialType))){
|
||||
$result['title'] = $decorate['title'];
|
||||
$result['price'] = (int)$decorate['price'];
|
||||
$result['base_image'] = localpath_to_netpath($decorate['base_image']);
|
||||
@@ -154,7 +156,7 @@ class Decorate extends Model
|
||||
*
|
||||
*/
|
||||
public function pay_decorate($uid, $did, $day=0,$from_type=1,$give_uid=0,$log_remark="",$num=1){
|
||||
if(empty($day) && in_array($from_type,[12,13])){
|
||||
if(empty($day) && in_array($from_type,array_keys($this->SpecialType))){
|
||||
$day = 0;
|
||||
}else{
|
||||
$day = db::name('vs_decorate_price')->where(['did'=>$did])->order('day asc')->value('day');
|
||||
@@ -176,7 +178,7 @@ class Decorate extends Model
|
||||
if(!$decorate_info){
|
||||
return ['code' => 0, 'msg' => '该装扮不存在'.$did, 'data' => null];
|
||||
}
|
||||
if(!in_array($decorate_info['type'],[12,13])){
|
||||
if(!in_array($decorate_info['type'],array_keys($this->SpecialType))){
|
||||
//该天数是否存在
|
||||
$map = [];
|
||||
$map = [
|
||||
@@ -256,7 +258,7 @@ class Decorate extends Model
|
||||
$data['num'] = 1;
|
||||
$result = db::name('vs_user_decorate')->insert($data);
|
||||
}else{
|
||||
if($decorate_info['type'] == 12){
|
||||
if(in_array($decorate_info['type'],array_keys($this->SpecialType))){
|
||||
$result = db::name('vs_user_decorate')->where('udid', $user_decorate_data['udid'])->update([
|
||||
'is_using' => 2,
|
||||
'num' => $user_decorate_data['num'] + $num,
|
||||
|
||||
Reference in New Issue
Block a user