| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?php
- // +----------------------------------------------------------------------
- // | saiadmin [ saiadmin快速开发框架 ]
- // +----------------------------------------------------------------------
- // | Author: your name
- // +----------------------------------------------------------------------
- namespace app\v1\model\gameLog;
- use plugin\saiadmin\basic\BaseNormalModel;
- /**
- * 充值排行模型
- */
- class SdkOrderRank extends BaseNormalModel
- {
- /**
- * 数据表主键
- * @var string
- */
- protected $pk = 'orderid';
- /**
- * 数据库表名称
- * @var string
- */
- protected $table = 'sdk_order_success';
- /**
- * 数据库连接
- * @var string
- */
- protected $connection = 'db_game_log';
- /**
- * 游戏名 保存数组转换
- */
- public function setGameIdAttr($value)
- {
- return json_encode($value, JSON_UNESCAPED_UNICODE);
- }
- /**
- * 游戏名 读取数组转换
- */
- public function getGameIdAttr($value)
- {
- return json_decode($value ?? '', true);
- }
- /**
- * 注册日期 搜索
- */
- public function searchRegDateAttr($query, $value)
- {
- $sTime = strtotime($value[0] . " 00:00:00");
- $eTime = strtotime($value[1] . " 23:59:59");
- $query->whereTime('reg_date', 'between', [$sTime, $eTime]);
- }
- /**
- * 充值日期 搜索
- */
- public function searchPayDateAttr($query, $value)
- {
- $sTime = strtotime($value[0] . " 00:00:00");
- $eTime = strtotime($value[1] . " 23:59:59");
- $query->whereTime('pay_date', 'between', [$sTime, $eTime]);
- }
- }
|