Commit 775bfd0e authored by wangzhengwen's avatar wangzhengwen

6.12

parent f8b8a793
...@@ -63,7 +63,7 @@ class ProjectService ...@@ -63,7 +63,7 @@ class ProjectService
} }
// 7. 恢复企业高校信用额度 // 7. 恢复企业高校信用额度
// $moneyResult = UserModel::where(['id' => $user['id'], 'is_del' => 0]) // $moneyResult = UserModel::where(['id' => $projectData['user_id'], 'is_del' => 0])
// ->inc('credit_money', $projectData['yusuan']) // ->inc('credit_money', $projectData['yusuan'])
// ->update(); // ->update();
// //
......
...@@ -20,7 +20,7 @@ class UserMoneyLog extends Model ...@@ -20,7 +20,7 @@ class UserMoneyLog extends Model
*/ */
public static function getUserMoneyRanking($limit = 10, $timeRange = 'all', $type = null) public static function getUserMoneyRanking($limit = 10, $timeRange = 'all', $type = null)
{ {
$query = self::field('user_id, SUM(money) as total_money') $query = self::field('user_id, SUM(money) as total_money, COUNT(*) as record_count')
->group('user_id') ->group('user_id')
->order('total_money', 'DESC') ->order('total_money', 'DESC')
->limit($limit); ->limit($limit);
...@@ -54,6 +54,7 @@ class UserMoneyLog extends Model ...@@ -54,6 +54,7 @@ class UserMoneyLog extends Model
if (!empty($ranking)) { if (!empty($ranking)) {
$userIds = array_column($ranking, 'user_id'); $userIds = array_column($ranking, 'user_id');
$users = User::whereIn('id', $userIds) $users = User::whereIn('id', $userIds)
->with(['headico'])
->where('is_del', 0) ->where('is_del', 0)
->column('username,realname,headico', 'id'); ->column('username,realname,headico', 'id');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment