用户随手拍后台详情

This commit is contained in:
2024-11-29 15:25:13 +08:00
parent 0db1a67e68
commit 2cf50f16fb
2 changed files with 12 additions and 2 deletions

View File

@ -24,14 +24,14 @@ class UserShare extends Controller
public function index()
{
$this->title = '用户随手拍';
$this->type_list = TicketType::getTypeList();
$this->type_list = TicketType::getList();
TicketUserShare::mQuery()->layTable(function () {
}, function (QueryHelper $query) {
$query->like(['title|content|ticket_address|contact_phone#keyword'])
->dateBetween(['create_at'])
->equal(['status', 'type_id']);
$query->with(['user'])->append(['imgs_arr', 'status_text', 'type_name', 'last_reply']);
$query->with(['user'])->append(['imgs_arr', 'type_name']);
});
}

View File

@ -10,4 +10,14 @@ class TicketUserShare extends Model
{
return str2arr($data['imgs'] ?: '', '|');
}
public function getTypeNameAttr($value, $data)
{
$type = $this->type()->find();
if (!empty($type)) {
return $type['name'];
} else {
return '未知';
}
}
}