|
|
@@ -39,9 +39,9 @@ class Im extends BaseController
|
|
|
->page($page)
|
|
|
->select();
|
|
|
} catch (Exception $e) {
|
|
|
- return error($e->getMessage());
|
|
|
+ return $this->error($e->getMessage());
|
|
|
}
|
|
|
- return success('', ['count' => $count, 'list' => $list]);
|
|
|
+ return $this->success(['count' => $count, 'list' => $list]);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -51,16 +51,16 @@ class Im extends BaseController
|
|
|
{
|
|
|
$params = $this->request->param();
|
|
|
if (empty($params['complaint_item_id'])) {
|
|
|
- return error('请选择投诉项');
|
|
|
+ return $this->error('请选择投诉项');
|
|
|
}
|
|
|
$user_id = $this->userInfo['user_id'];
|
|
|
$user = User::where('user_id', $user_id)->find();
|
|
|
if (!$user) {
|
|
|
- return error('用户不存在');
|
|
|
+ return $this->error('用户不存在');
|
|
|
}
|
|
|
$exist = Complaint::where('user_id', $user_id)->where('cs_uid', $user->cs_uid)->find();
|
|
|
if ($exist) {
|
|
|
- return error('您已投诉过该客服,无需重复投诉');
|
|
|
+ return $this->error('您已投诉过该客服,无需重复投诉');
|
|
|
}
|
|
|
|
|
|
Complaint::create([
|
|
|
@@ -68,16 +68,16 @@ class Im extends BaseController
|
|
|
'cs_uid' => $user->cs_uid,
|
|
|
'complaint_item_id' => $params['complaint_item_id'],
|
|
|
'remark' => $params['remark'] ?? '',
|
|
|
+ 'language_code' => $this->lang,
|
|
|
]);
|
|
|
$data = $this->request->param();
|
|
|
$data['user_id'] = $user['id'];
|
|
|
- $data['create_time'] = time();
|
|
|
$data['status'] = 0;
|
|
|
$data['type'] = 1;
|
|
|
- $res = Db::name('complaint')->insert($data);
|
|
|
- if ($res) {
|
|
|
- return $this->success('提交成功');
|
|
|
- }
|
|
|
+ Db::name('complaint')->insert($data);
|
|
|
+
|
|
|
+ return $this->success('提交成功');
|
|
|
+
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -106,9 +106,9 @@ class Im extends BaseController
|
|
|
->select();
|
|
|
|
|
|
} catch (Exception $e) {
|
|
|
- return error($e->getMessage());
|
|
|
+ return $this->error($e->getMessage());
|
|
|
}
|
|
|
- return success('', [ 'count' => $count, 'list' => $list]);
|
|
|
+ return $this->success([ 'count' => $count, 'list' => $list]);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -124,9 +124,9 @@ class Im extends BaseController
|
|
|
$info->save();
|
|
|
}
|
|
|
} catch (Exception $e) {
|
|
|
- return error($e->getMessage());
|
|
|
+ return $this->error($e->getMessage());
|
|
|
}
|
|
|
- return success('');
|
|
|
+ return $this->success([]);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -152,7 +152,7 @@ class Im extends BaseController
|
|
|
} catch (Exception $e) {
|
|
|
return error($e->getMessage());
|
|
|
}
|
|
|
- return success('', [ 'count' => $count, 'list' => $list]);
|
|
|
+ return $this->success([ 'count' => $count, 'list' => $list]);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -173,9 +173,9 @@ class Im extends BaseController
|
|
|
$question->save();
|
|
|
}
|
|
|
} catch (Exception $e) {
|
|
|
- return error($e->getMessage());
|
|
|
+ return $this->error($e->getMessage());
|
|
|
}
|
|
|
- return success('');
|
|
|
+ return $this->success([]);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -187,10 +187,10 @@ class Im extends BaseController
|
|
|
$user_id = $this->userInfo['user_id'];
|
|
|
$user = User::where('user_id', $user_id)->find();
|
|
|
if (!$user) {
|
|
|
- return error('用户不存在');
|
|
|
+ return $this->error('用户不存在');
|
|
|
}
|
|
|
if ($user->role > 0) {
|
|
|
- return error('系统管理员无法转人工');
|
|
|
+ return $this->error('系统管理员无法转人工');
|
|
|
}
|
|
|
// ($user->service_status == -1) {
|
|
|
$user->service_status = 0;
|
|
|
@@ -214,9 +214,9 @@ class Im extends BaseController
|
|
|
Message::sendMsg($param, 0);
|
|
|
//
|
|
|
} catch (Exception $e) {
|
|
|
- return error($e->getMessage());
|
|
|
+ return $this->error($e->getMessage());
|
|
|
}
|
|
|
- return success('');
|
|
|
+ return $this->success([]);
|
|
|
}
|
|
|
// 获取联系人列表
|
|
|
public function getContacts()
|