You've already forked guangan
用户随手拍后台详情
This commit is contained in:
@ -24,14 +24,14 @@ class UserShare extends Controller
|
|||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
$this->title = '用户随手拍';
|
$this->title = '用户随手拍';
|
||||||
$this->type_list = TicketType::getTypeList();
|
$this->type_list = TicketType::getList();
|
||||||
TicketUserShare::mQuery()->layTable(function () {
|
TicketUserShare::mQuery()->layTable(function () {
|
||||||
|
|
||||||
}, function (QueryHelper $query) {
|
}, function (QueryHelper $query) {
|
||||||
$query->like(['title|content|ticket_address|contact_phone#keyword'])
|
$query->like(['title|content|ticket_address|contact_phone#keyword'])
|
||||||
->dateBetween(['create_at'])
|
->dateBetween(['create_at'])
|
||||||
->equal(['status', 'type_id']);
|
->equal(['status', 'type_id']);
|
||||||
$query->with(['user'])->append(['imgs_arr', 'status_text', 'type_name', 'last_reply']);
|
$query->with(['user'])->append(['imgs_arr', 'type_name']);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,4 +10,14 @@ class TicketUserShare extends Model
|
|||||||
{
|
{
|
||||||
return str2arr($data['imgs'] ?: '', '|');
|
return str2arr($data['imgs'] ?: '', '|');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function getTypeNameAttr($value, $data)
|
||||||
|
{
|
||||||
|
$type = $this->type()->find();
|
||||||
|
if (!empty($type)) {
|
||||||
|
return $type['name'];
|
||||||
|
} else {
|
||||||
|
return '未知';
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user