From 54af6a7f46258667cc2a7eddf10ee98949b3bac3 Mon Sep 17 00:00:00 2001 From: "WIN-C27C5MSVTPO\\16961" <1696136552@qq.com> Date: Mon, 22 Dec 2025 16:51:58 +0800 Subject: [PATCH] 1 --- app/common/service/UserService.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/app/common/service/UserService.php b/app/common/service/UserService.php index 84689de..a0c705d 100644 --- a/app/common/service/UserService.php +++ b/app/common/service/UserService.php @@ -5,6 +5,7 @@ namespace app\common\service; use app\common\logic\AuthLogic; use app\common\model\Post; use app\common\model\PostOld; +use app\common\model\Sku; use app\common\model\UserOld; use app\common\validate\UserValidate; use app\common\traits\crud\CrudServiceTrait; @@ -270,7 +271,7 @@ class UserService //'unionid' => $wxinfo['unionid'], 'name' => $name, 'sn' => $sn, - 'is_release' => 2, + 'is_release' => 0, 'avatar' => 'bsh_datax/user/20251021/a4ee815405a1506abeec1af0f738f70f_68f6e76514b66.jpg' ] ); @@ -309,11 +310,15 @@ class UserService $postOld = PostOld::where('mobile', $mobile)->get(); if (!empty($postOld)) { foreach ($postOld as $item) { + $sku = Sku::where('model', $item->model)->first(); + if(!$sku){ //如果商品不存在则直接跳过 + continue; + } $post = [ "id" => $item->id, "user_id" => $uinfo->id, "category_id" => $item->id, - "sku_id" => $item->sku_id, + "sku_id" => $sku->id, "content" => $item->content, "shop_name" => $item->shop_name, "location_name" => $item->location_name,