根据对接实施方案文档修改
This commit is contained in:
@@ -2,20 +2,29 @@
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
use app\common\model\traits\TimestampInteger;
|
||||
use support\think\Model;
|
||||
|
||||
/**
|
||||
* MallItem
|
||||
* type: 1=BONUS(红利), 2=PHYSICAL(实物), 3=WITHDRAW(提现档位)
|
||||
*/
|
||||
class MallItem extends Model
|
||||
{
|
||||
use TimestampInteger;
|
||||
|
||||
protected $name = 'mall_item';
|
||||
|
||||
protected bool $autoWriteTimestamp = true;
|
||||
|
||||
public const TYPE_BONUS = 1;
|
||||
public const TYPE_PHYSICAL = 2;
|
||||
public const TYPE_WITHDRAW = 3;
|
||||
|
||||
protected array $type = [
|
||||
'create_time' => 'integer',
|
||||
'update_time' => 'integer',
|
||||
'amount' => 'float',
|
||||
'multiplier' => 'integer',
|
||||
];
|
||||
|
||||
public function admin(): \think\model\relation\BelongsTo
|
||||
{
|
||||
return $this->belongsTo(\app\admin\model\Admin::class, 'admin_id', 'id');
|
||||
|
||||
26
app/common/model/MallPlayxSession.php
Normal file
26
app/common/model/MallPlayxSession.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace app\common\model;
|
||||
|
||||
use support\think\Model;
|
||||
|
||||
/**
|
||||
* PlayX 会话缓存
|
||||
*/
|
||||
class MallPlayxSession extends Model
|
||||
{
|
||||
protected string $name = 'mall_playx_session';
|
||||
|
||||
protected bool $autoWriteTimestamp = true;
|
||||
|
||||
protected array $type = [
|
||||
// 这里需要显式声明 create_time / update_time 为 integer,
|
||||
// 否则 ThinkORM 可能把 bigint 时间戳当成字符串,导致写入时出现 now 字符串问题。
|
||||
'create_time' => 'integer',
|
||||
'update_time' => 'integer',
|
||||
'expire_time' => 'integer',
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user