63 lines
1.6 KiB
PHP
63 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace app\api\controller;
|
|
|
|
use app\common\controller\BaseCom;
|
|
use think\Controller;
|
|
use think\Db;
|
|
|
|
class Level extends BaseCom
|
|
{
|
|
//初始化
|
|
protected function initialize()
|
|
{
|
|
//允许跨域
|
|
header('Access-Control-Allow-Origin: *');
|
|
}
|
|
//魅力等级规则说明
|
|
public function get_level_rule()
|
|
{
|
|
$uid = $this->uid;
|
|
$reslut = model('Level')->get_level_rule($uid);
|
|
return V($reslut['code'],$reslut['msg'], $reslut['data']);
|
|
}
|
|
|
|
//财富等级规则说明
|
|
public function get_wealth_rule(){
|
|
$uid = $this->uid;
|
|
$reslut = model('Level')->get_wealth_rule($uid);
|
|
return V($reslut['code'],$reslut['msg'], $reslut['data']);
|
|
}
|
|
|
|
//领取金币奖励
|
|
public function get_gold_reward(){
|
|
$uid = $this->uid;
|
|
$reslut = model('Level')->get_wealth_level_reward($uid);
|
|
return V($reslut['code'],$reslut['msg'], $reslut['data']);
|
|
}
|
|
|
|
//歌手等级
|
|
public function get_singer_level(){
|
|
$uid = $this->uid;
|
|
$reslut = model('Level')->get_singer_level($uid);
|
|
return V($reslut['code'],$reslut['msg'], $reslut['data']);
|
|
}
|
|
//是否歌手
|
|
public function is_singer(){
|
|
$uid = $this->uid;
|
|
$singer = model('api/SingerSong')->singerAuthStatus($uid);
|
|
if($singer['status'] == 1){
|
|
$data = [
|
|
'status' => 1,
|
|
'level' => $singer['level'],
|
|
];
|
|
}else{
|
|
$data = [
|
|
'status' => 0,
|
|
'level' => 0,
|
|
];
|
|
}
|
|
return V(1,'成功', $data);
|
|
}
|
|
}
|