作者 李忠强
1 个管道 的构建 通过 耗费 1 秒

超过比例字段调整

... ... @@ -185,7 +185,7 @@ class Mycenter extends Api
$userid = $this->request->post('userid',$this->auth->id);
$data = [];
$usercount = Db::name('user')->count();
$userlist = Db::name('user')->where('idea_number','<',$usercount)->count();
$userlist = Db::name('user')->where('idea_number','<',$this->auth->idea_number)->count();
$percentage = $userlist ? round($userlist/$usercount*100,1) : 0;
$data['percentage'] = $percentage;
$ideaUserScore = Db::name('user_idea_score')
... ...
... ... @@ -26,7 +26,7 @@ class Auth
//默认配置
protected $config = [];
protected $options = [];
protected $allowFields = ['id', 'username', 'nickname', 'mobile', 'avatar', 'score'];
protected $allowFields = ['id', 'username', 'nickname', 'mobile', 'avatar', 'score', 'idea_number'];
public function __construct($options = [])
{
... ...