app\services\message\service\StoreServiceRecordServices 文件中:
public function saveRecord(int $uid, int $toUid, string $message, int $type, int $messageType, int $num, int $isTourist = 0, string $nickname = '', string $avatar = '')
{
$info = $this->dao->get(['user_id' => $toUid, 'to_uid' => $uid]);
if ($info) {
$info->type = $type;
$info->message = $message;
$info->message_type = $messageType;
$info->update_time = time();
$info->mssage_num = $num;
if ($avatar) $info->avatar = $avatar;
if ($nickname) $info->nickname = $nickname;
$info->save();
$this->dao->update(['user_id' => $uid, 'to_uid' => $toUid], ['message' => $message, 'message_type' => $messageType]);
return $info->toArray();
}
}
此方法中, $info = $this->dao->get(['user_id' => $toUid, 'to_uid' => $uid]); 返回的是 数组 还是 对象 ?
如果是数组, 后边的 $info->type = $type; 这种写法,在 thinkphp6 中的写法是正确的吗?
【产品名称】:多店版
{{item.user_info.nickname ? item.user_info.nickname : item.user_name}}
作者 管理员 企业
{{itemf.name}}
{{itemc.user_info.nickname}}
{{itemc.user_name}}
回复 {{itemc.comment_user_info.nickname}}
{{itemf.name}}