| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <?php
- // +----------------------------------------------------------------------
- // | saiadmin [ saiadmin快速开发框架 ]
- // +----------------------------------------------------------------------
- // | Author: your name
- // +----------------------------------------------------------------------
- namespace app\v1\logic\gameLog;
- use plugin\saiadmin\basic\BaseLogic;
- use plugin\saiadmin\exception\ApiException;
- use plugin\saiadmin\utils\Helper;
- use app\v1\model\gameLog\SdkRegLog;
- /**
- * 注册日志逻辑层
- */
- class SdkRegLogLogic extends BaseLogic
- {
- /**
- * 构造函数
- */
- public function __construct()
- {
- $this->model = new SdkRegLog();
- }
- /**
- * 分页查询数据
- * @param $query
- * @return mixed
- */
- public function getList($query): mixed
- {
- $saiType = request()->input('saiType', 'list');
- $page = request()->input('page', 1);
- $limit = request()->input('limit', 10);
- $orderBy = request()->input('orderBy', '');
- $regTime = request()->input('reg_time', '');
- $orderType = request()->input('orderType', $this->orderType);
- if(empty($orderBy)) {
- $orderBy = $this->orderField !== '' ? $this->orderField : $this->model->getPk();
- }
- $query->order($orderBy, $orderType);
-
- $tableName = 'sdk_reg_log_'.date('Ym',strtotime($regTime));
-
-
- // 切换表名
- $query->table($tableName);
- if ($saiType === 'all') {
- return $query->select()->toArray();
- }
- return $query->paginate($limit, false, ['page' => $page])->toArray();
- }
- }
|