This commit is contained in:
2025-08-14 17:19:26 +08:00
parent 30abda5ba7
commit 281248fd04
245 changed files with 21051 additions and 61 deletions

View File

@@ -0,0 +1,41 @@
<?php
namespace app\czg\app\controller;
use app\api\model\CommonInfo;
use app\api\model\Orders;
use app\api\model\TbUser;
use app\common\controller\Frontend;
use app\common\library\DatabaseRoute;
use app\exception\CzgException;
use app\queue\DiscReceiveQueue;
use ba\Random;
use think\facade\Db;
class DiscSpinningRecordController extends Frontend
{
// 查询大转盘抽奖记录
public function selectDiscSpinningRecord()
{
$get = $this->request->get();
if(empty($get['source']) || empty($get['page']) || empty($get['limit'])) {
$this->error('参数不完整');
}
$user = $this->auth->getUser();
$db = Db::connect(DatabaseRoute::getConnection('disc_spinning_record', ['user_id' => $user['user_id']]));
$list = $db->name('disc_spinning_record')
->where(['user_id' => $user['user_id']]);
$count = $list->count();
$list = $list->order('create_time', 'asc')
->limit(page($get['page'], $get['limit']), $get['limit'])
->select()->toArray();
$this->success('ok', [
'currPage' => $get['page'],
'pageSize' => $get['limit'],
'records' => convertToCamelCase($list),
'totalCount' => $count,
'totalPage' => ceil($count / $get['limit']),
]);
}
}