|
|
@ -9,6 +9,7 @@ use app\model\AccountFrozenModel; |
|
|
|
use app\model\AdminModel; |
|
|
|
use app\model\AuthRoleModel; |
|
|
|
use app\model\AwsS3Model; |
|
|
|
use app\model\BusinessLogModel; |
|
|
|
use app\model\CountryModel; |
|
|
|
use app\model\GroupLeaderWithUserModel; |
|
|
|
use app\model\PurchaseVipModel; |
|
|
@ -1568,6 +1569,60 @@ class UserService extends AdminBaseService |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 添加话务 |
|
|
|
public function addBusiness($param, $adminId) |
|
|
|
{ |
|
|
|
try { |
|
|
|
if (empty($param['from_content'])) { |
|
|
|
return $this->toData('400', '参错错误'); |
|
|
|
} |
|
|
|
|
|
|
|
$result = BusinessLogModel::create([ |
|
|
|
'from_uid' => $adminId, |
|
|
|
'reply_uid' => 0, |
|
|
|
'from_content' => $param['from_content'], |
|
|
|
'is_reply' => 0 |
|
|
|
]); |
|
|
|
|
|
|
|
return $this->toData('0', 'Successful', [$result]); |
|
|
|
} catch (\Exception $e) { |
|
|
|
return $this->toData('500', '系统异常 请稍后重试', [$e->getMessage(), $e->getTrace()]); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 获取话务队列 |
|
|
|
public function getBusinessList($param, $adminId) |
|
|
|
{ |
|
|
|
try { |
|
|
|
if (empty($param['page']) || !is_numeric($param['page'])) { |
|
|
|
return $this->toData('400', '参错错误'); |
|
|
|
} |
|
|
|
if (empty($param['limit']) || !is_numeric($param['limit'])) { |
|
|
|
return $this->toData('400', '参错错误'); |
|
|
|
} |
|
|
|
$where = ['is_reply'=>0]; // 只返回未回复的 |
|
|
|
if (!empty($param['reply_uid'])) { |
|
|
|
$where['reply_uid'] = $param['reply_uid']; |
|
|
|
} |
|
|
|
if (isset($param['is_reply'])) { |
|
|
|
$where['is_reply'] = $param['is_reply']; |
|
|
|
} |
|
|
|
|
|
|
|
$list = BusinessLogModel::where($where)->order('id', 'desc')->paginate([ |
|
|
|
'list_rows' => $param['limit'], |
|
|
|
'page' => $param['page'], |
|
|
|
]); |
|
|
|
return $this->toData('0', 'Successful', [ |
|
|
|
'list' => $list->items(), |
|
|
|
'page' => $list->currentPage(), |
|
|
|
'total' => $list->total(), |
|
|
|
'last_page' => $list->lastPage(), |
|
|
|
]); |
|
|
|
} catch (\Exception $e) { |
|
|
|
return $this->toData('500', '系统异常 请稍后重试', [$e->getMessage(), $e->getTrace()]); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|