|
@ -6,6 +6,7 @@ use app\home\validate\UserValidate; |
|
|
use app\model\CountryModel; |
|
|
use app\model\CountryModel; |
|
|
use app\model\CustomerRelationalModel; |
|
|
use app\model\CustomerRelationalModel; |
|
|
use app\model\FileModel; |
|
|
use app\model\FileModel; |
|
|
|
|
|
use app\model\UserChatGroupModel; |
|
|
use app\model\UserChatLinkModel; |
|
|
use app\model\UserChatLinkModel; |
|
|
use app\model\UserContractModel; |
|
|
use app\model\UserContractModel; |
|
|
use app\model\UserDigitalModel; |
|
|
use app\model\UserDigitalModel; |
|
@ -133,7 +134,7 @@ class UserService extends BaseHomeService |
|
|
return $this->toData('100403', 'Please log in first', []); |
|
|
return $this->toData('100403', 'Please log in first', []); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
$info = UserModel::getFieldsByUserId('trade_password,lever_status,gender,last_name,first_name,real_status,country_id,user_no,nick_name,email,phone_number,country_code,is_real,head_img_id,invite_code,is_test_user', $userId); |
|
|
$info = UserModel::getFieldsByUserId('trade_password,lever_status,gender,last_name,first_name,real_status,country_id,user_no,nick_name,email,phone_number,country_code,agent_id,is_real,head_img_id,invite_code,is_test_user', $userId); |
|
|
if (empty($info)) { |
|
|
if (empty($info)) { |
|
|
return $this->toData('100400', 'The user does not exist.', []); |
|
|
return $this->toData('100400', 'The user does not exist.', []); |
|
|
} |
|
|
} |
|
@ -179,7 +180,17 @@ class UserService extends BaseHomeService |
|
|
$customerChatName = $customerChatInfo->chat_name; |
|
|
$customerChatName = $customerChatInfo->chat_name; |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
// 获取当前用户代理创建的群聊信息 |
|
|
|
|
|
$group_chat_name = ""; |
|
|
|
|
|
$group_chat_uuid = ""; |
|
|
|
|
|
if ($info['agent_id']) { |
|
|
|
|
|
$agentGroup = UserChatGroupModel::where(['user_id'=>$info['agent_id']])->find(); |
|
|
|
|
|
if (empty($agentGroup)) { |
|
|
|
|
|
return $this->toData('100400', 'Agent chat group is null.', []); |
|
|
|
|
|
} |
|
|
|
|
|
$group_chat_name = $agentGroup->group_name; |
|
|
|
|
|
$group_chat_uuid = $agentGroup->group_uuid; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// 返回数据 |
|
|
// 返回数据 |
|
|
return $this->toData('0', 'Modification successful.', [ |
|
|
return $this->toData('0', 'Modification successful.', [ |
|
@ -206,13 +217,42 @@ class UserService extends BaseHomeService |
|
|
'user_chat_name' => $userChatName, |
|
|
'user_chat_name' => $userChatName, |
|
|
'customer_chat_uuid' => $customerChatUuid, |
|
|
'customer_chat_uuid' => $customerChatUuid, |
|
|
'customer_chat_name' => $customerChatName, |
|
|
'customer_chat_name' => $customerChatName, |
|
|
'customer_chat_avatar' => '/bs/image/default.jpeg' |
|
|
'customer_chat_avatar' => '/bs/image/default.jpeg', |
|
|
|
|
|
'group_chat_name' => $group_chat_name, |
|
|
|
|
|
'group_chat_uuid' => $group_chat_uuid, |
|
|
]); |
|
|
]); |
|
|
} catch (\Exception $exception) { |
|
|
} catch (\Exception $exception) { |
|
|
return $this->toData('100500', 'The system is busy.', [$exception->getMessage(), $exception->getTrace()]); |
|
|
return $this->toData('100500', 'The system is busy.', [$exception->getMessage(), $exception->getTrace()]); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 查询代理下的一个主播信息 |
|
|
|
|
|
public function getAnchorForAgent($userId) |
|
|
|
|
|
{ |
|
|
|
|
|
try { |
|
|
|
|
|
if (empty($userId) || $userId <= 0) { |
|
|
|
|
|
return $this->toData('100403', 'Please log in first', []); |
|
|
|
|
|
} |
|
|
|
|
|
// 查询用户所属的代理id |
|
|
|
|
|
$info = UserModel::getFieldsByUserId('trade_password,lever_status,gender,last_name,first_name,real_status,country_id,user_no,nick_name,email,phone_number,country_code,agent_id,is_real,head_img_id,invite_code,is_test_user', $userId); |
|
|
|
|
|
if (empty($info)) { |
|
|
|
|
|
return $this->toData('100400', 'The user does not exist.', []); |
|
|
|
|
|
} |
|
|
|
|
|
if (empty($info['agent_id'])) { |
|
|
|
|
|
return $this->toData('100400', 'The user does not have a agent.', []); |
|
|
|
|
|
} |
|
|
|
|
|
// 查询代理下的一个主播信息 |
|
|
|
|
|
$agentGroup = UserChatGroupModel::where(['user_id'=>$info['agent_id']])->find()->toArray(); |
|
|
|
|
|
if (empty($agentGroup)) { |
|
|
|
|
|
return $this->toData('100400', 'The chat group is error.', []); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return $this->toData('0', 'Modification successful.', $agentGroup); |
|
|
|
|
|
} catch (\Exception $exception) { |
|
|
|
|
|
return $this->toData('100500', 'The system is busy.', [$exception->getMessage(), $exception->getTrace()]); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* @desc 设置用户国家 |
|
|
* @desc 设置用户国家 |
|
|
* @param $userId |
|
|
* @param $userId |
|
|