- 新增师傅资质审核模块及权限 - 未审核通过的师傅默认禁用接单状态 - 新增售后退款申诉功能与相关界面 - 新增用户钱包管理及充值功能 - 更新服务定价矩阵相关数据库结构 - 修复微信支付证书验证问题
88 行
1.8 KiB
PHP
88 行
1.8 KiB
PHP
<?php
|
||
|
||
namespace app\admin\model;
|
||
|
||
use think\Model;
|
||
|
||
|
||
class Appeal extends Model
|
||
{
|
||
|
||
|
||
|
||
|
||
|
||
// 表名
|
||
protected $name = 'appeal';
|
||
|
||
// 自动写入时间戳字段
|
||
protected $autoWriteTimestamp = 'integer';
|
||
|
||
// 定义时间戳字段名
|
||
protected $createTime = 'createtime';
|
||
protected $updateTime = 'updatetime';
|
||
protected $deleteTime = false;
|
||
|
||
// 追加属性
|
||
protected $append = [
|
||
'type_text',
|
||
'status_text'
|
||
];
|
||
|
||
|
||
|
||
public function getTypeList()
|
||
{
|
||
return [
|
||
'misjudge' => __('Misjudge'),
|
||
'review' => __('Review'),
|
||
'deduct' => __('Deduct'),
|
||
'other' => __('Other'),
|
||
'aftersale' => '用户售后退款'
|
||
];
|
||
}
|
||
|
||
public function getStatusList()
|
||
{
|
||
return ['wait' => __('Wait'), 'handling' => __('Handling'), 'done' => __('Done'), 'reject' => __('Reject')];
|
||
}
|
||
|
||
|
||
public function getTypeTextAttr($value, $data)
|
||
{
|
||
$value = $value ?: ($data['type'] ?? '');
|
||
$list = $this->getTypeList();
|
||
return $list[$value] ?? '';
|
||
}
|
||
|
||
|
||
public function getStatusTextAttr($value, $data)
|
||
{
|
||
$value = $value ?: ($data['status'] ?? '');
|
||
$list = $this->getStatusList();
|
||
return $list[$value] ?? '';
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
public function order()
|
||
{
|
||
return $this->belongsTo('Order', 'order_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||
}
|
||
|
||
public function master()
|
||
{
|
||
return $this->belongsTo('Master', 'master_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||
}
|
||
|
||
/**
|
||
* 售后退款申诉的发起用户(用户端售后申请时记录 user_id)
|
||
*/
|
||
public function user()
|
||
{
|
||
return $this->belongsTo('app\admin\model\User', 'user_id', 'id', [], 'LEFT')->setEagerlyType(0);
|
||
}
|
||
}
|