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]); 返回的是 數(shù)組 還是 對象 ?
如果是數(shù)組, 后邊的 $info->type = $type; 這種寫法,在 thinkphp6 中的寫法是正確的嗎?
【產(chǎn)品名稱】:多店版