|
|
@@ -26,10 +26,11 @@ class Complaint extends BaseController
|
|
|
$language_code = $params['language_code'] ?? $this->lang;
|
|
|
|
|
|
$query = ComplaintModel::alias('complaint')->join('admin', 'admin.id=complaint.cs_uid','left')
|
|
|
- ->where('complaint.language_code', $language_code);
|
|
|
+ ->join('user', 'user.uid=complaint.cs_uid','left')
|
|
|
+ ->where('complaint.language_code', $language_code);
|
|
|
if (!empty($params['keyword'])) {
|
|
|
- $query = $query->where('admin.nickname', 'like', '%'.$params['keyword'].'%')
|
|
|
- ->whereOr('admin.phone', 'like', '%'.$params['keyword'].'%');
|
|
|
+ $query = $query->where('user.realname', 'like', '%'.$params['keyword'].'%')
|
|
|
+ ->whereOr('user.phone', 'like', '%'.$params['keyword'].'%');
|
|
|
}
|
|
|
if (!empty($params['complaint_item_id'])) {
|
|
|
$query = $query->where('complaint.complaint_item_id', $params['complaint_item_id']);
|
|
|
@@ -45,7 +46,7 @@ class Complaint extends BaseController
|
|
|
}
|
|
|
$count = $query->count();
|
|
|
$list = $query->with(['complaint_item', 'user', 'operation'])
|
|
|
- ->field(['complaint.*', 'admin.nickname','admin.phone'])
|
|
|
+ ->field(['complaint.*', 'user.realname','user.phone'])
|
|
|
->order('complaint.created_at','desc')
|
|
|
->limit($limit)
|
|
|
->page($page)
|
|
|
@@ -67,11 +68,7 @@ class Complaint extends BaseController
|
|
|
if (!$complaint) {
|
|
|
return $this->error('投诉项不存在');
|
|
|
}
|
|
|
- if ($complaint->status == 1) {
|
|
|
- return $this->error('已处理');
|
|
|
- }
|
|
|
$complaint->result = $result;
|
|
|
- $complaint->operation_id = $this->admin_id;
|
|
|
$complaint->save();
|
|
|
} catch (Exception $e) {
|
|
|
return $this->error($e->getMessage());
|