You've already forked guangan
改字段
This commit is contained in:
@ -31,9 +31,9 @@ class Ticket extends Controller
|
|||||||
|
|
||||||
}, function (QueryHelper $query) {
|
}, function (QueryHelper $query) {
|
||||||
$query->like(['title|content|contact_name|ticket_address|contact_phone#keyword'])
|
$query->like(['title|content|contact_name|ticket_address|contact_phone#keyword'])
|
||||||
->dateBetween(['create_at', 'last_activity_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->append(['imgs_arr', 'status_text', 'type_name', 'last_reply']);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -56,7 +56,7 @@ class Ticket extends Controller
|
|||||||
public function _form_filter(&$data)
|
public function _form_filter(&$data)
|
||||||
{
|
{
|
||||||
if ($this->request->isPost()) {
|
if ($this->request->isPost()) {
|
||||||
$data['uid'] = 0;
|
$data['user_id'] = 0;
|
||||||
}
|
}
|
||||||
$data['status'] = 0;
|
$data['status'] = 0;
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace plugin\ticket\model;
|
namespace plugin\ticket\model;
|
||||||
|
|
||||||
use plugin\account\model\PluginAccountBind;
|
|
||||||
use think\admin\Model;
|
use think\admin\Model;
|
||||||
|
|
||||||
class TicketTicket extends Model
|
class TicketTicket extends Model
|
||||||
@ -15,7 +14,7 @@ class TicketTicket extends Model
|
|||||||
|
|
||||||
public function user()
|
public function user()
|
||||||
{
|
{
|
||||||
return $this->belongsTo(PluginAccountBind::class, 'uid');
|
return $this->morphTo('user');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function reply()
|
public function reply()
|
||||||
@ -23,6 +22,11 @@ class TicketTicket extends Model
|
|||||||
return $this->hasMany(TicketReply::class, 'ticket_id')->order("create_at", 'asc');
|
return $this->hasMany(TicketReply::class, 'ticket_id')->order("create_at", 'asc');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function source()
|
||||||
|
{
|
||||||
|
return $this->morphTo();
|
||||||
|
}
|
||||||
|
|
||||||
public function getImgsArrAttr($value, $data)
|
public function getImgsArrAttr($value, $data)
|
||||||
{
|
{
|
||||||
return str2arr($data['imgs'] ?: '', '|');
|
return str2arr($data['imgs'] ?: '', '|');
|
||||||
|
Reference in New Issue
Block a user