diff --git a/app/controller/AdminStatistics.php b/app/controller/AdminStatistics.php index e84fc74..3bbe842 100644 --- a/app/controller/AdminStatistics.php +++ b/app/controller/AdminStatistics.php @@ -9,10 +9,8 @@ use app\model\AdminDownScoresRecords; use app\model\AdminUpScoresRecords; use app\model\AgentDownScoresRecords; use app\model\AgentUpScoresRecords; -use app\model\AgentUser; use think\exception\ValidateException; use think\facade\Request; -use think\facade\Session; use app\model\User as UserModel; class AdminStatistics extends BaseController @@ -31,16 +29,13 @@ class AdminStatistics extends BaseController $userData = UserModel::where('status',1)->field('SUM(withdrawal_balance) as quota')->find(); - $agentData = AgentUser::where('status',1)->field('SUM(withdrawal_balance) as quota')->find(); - $user_quota = $userData->quota ?? 0; - $agent_quota = $agentData->quota ?? 0; return $this->renderSuccess('数据返回成功',[ 'update_time' => date("Y/m/d H:i",time()), 'down_scores_quota' => [ 'title' => '待下分额度', - 'quota' => empty($user_quota) && empty($agent_quota) ? "0" : bcadd($user_quota,$agent_quota,2) + 'quota' => $user_quota ] ]); } @@ -55,9 +50,10 @@ class AdminStatistics extends BaseController public function userStatistics() { - $userData = UserModel::where('status',1)->field('count(id) as num')->find(); + $userData = UserModel::where('status',1)->where('identity',3)->field('count(id) as num')->find(); + + $agentData = UserModel::where('status',1)->where('identity',2)->field('count(id) as num')->find(); - $agentData = AgentUser::where('status',1)->field('count(id) as num')->find(); $user_num = $userData->num ?? 0; $agent_num = $agentData->num ?? 0; $sum_num = $user_num + $agent_num;