15090180611 28f2056fb6 活动订单后台查询优化
活动提现后台查询优化
财务结算记录后台查询优化
活动后台查询优化
用户发售后单接口
发布人处理售后接口
2025-04-15 18:22:48 +08:00

60 lines
1.3 KiB
PHP

<?php
namespace app\admin\model\school\activity\order;
use think\Model;
use traits\model\SoftDelete;
class OrderLog extends Model
{
use SoftDelete;
// 表名
protected $name = 'school_activity_order_log';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'integer';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected $deleteTime = 'deletetime';
// 追加属性
protected $append = [
'status_text'
];
public function getStatusList()
{
return ['-3' => __('Status -3'), '0' => __('Status 0'), '2' => __('Status 2'), '3' => __('Status 3'), '4' => __('Status 4'), '5' => __('Status 5'), '6' => __('Status 6'),'7' => __('Status 7'), '9' => __('Status 9')];
}
public function getStatusTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
$list = $this->getStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
public function order()
{
return $this->belongsTo(Order::class, 'activity_order_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
public function user()
{
return $this->belongsTo('app\common\model\User', 'oper_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
}