|
@@ -18,6 +18,7 @@ use library\services\UtilService;
|
|
|
use library\utils\UtilsTool;
|
|
use library\utils\UtilsTool;
|
|
|
use think\facade\Db;
|
|
use think\facade\Db;
|
|
|
use think\Image;
|
|
use think\Image;
|
|
|
|
|
+use think\Db as D;
|
|
|
|
|
|
|
|
use app\model\api\AppBug;
|
|
use app\model\api\AppBug;
|
|
|
use app\model\api\User as UserModel;
|
|
use app\model\api\User as UserModel;
|
|
@@ -310,18 +311,13 @@ class Pub extends BaseController
|
|
|
*/
|
|
*/
|
|
|
public function getCardLookCountRank(Request $request)
|
|
public function getCardLookCountRank(Request $request)
|
|
|
{
|
|
{
|
|
|
- [$startTime, $endTime] = UtilService::getMore([
|
|
|
|
|
- ['time', 0],
|
|
|
|
|
- ['times', time()],
|
|
|
|
|
- ], $request, true);
|
|
|
|
|
$list = (new UserModel)
|
|
$list = (new UserModel)
|
|
|
- -> where('card_look_count', '>', 0)
|
|
|
|
|
- -> whereBetweenTime('update_time', [$startTime, $endTime])
|
|
|
|
|
- -> order('card_look_count', 'DESC')
|
|
|
|
|
- -> limit(6)
|
|
|
|
|
- -> field('uid, nickname, avatar, card_look_count')
|
|
|
|
|
- -> select()
|
|
|
|
|
- -> toArray();
|
|
|
|
|
|
|
+ ->where('card_look_count', '>', 0)
|
|
|
|
|
+ ->order('card_look_count', 'DESC')
|
|
|
|
|
+ ->limit(6)
|
|
|
|
|
+ ->field('uid, nickname, avatar, card_look_count')
|
|
|
|
|
+ ->select()
|
|
|
|
|
+ ->toArray();
|
|
|
foreach ($list as &$item) {
|
|
foreach ($list as &$item) {
|
|
|
$template = (new UserModel)->getApiWorkerList($item['uid']);
|
|
$template = (new UserModel)->getApiWorkerList($item['uid']);
|
|
|
$item['template_id'] = $template['id'];
|
|
$item['template_id'] = $template['id'];
|