add
This commit is contained in:
41
app/czg/app/controller/DiscSpinningRecordController.php
Normal file
41
app/czg/app/controller/DiscSpinningRecordController.php
Normal 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']),
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user