老数据副表
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
namespace app\common\service;
|
||||
|
||||
use app\common\logic\AuthLogic;
|
||||
use app\common\model\Post;
|
||||
use app\common\model\PostOld;
|
||||
use app\common\model\UserOld;
|
||||
use app\common\validate\UserValidate;
|
||||
use app\common\traits\crud\CrudServiceTrait;
|
||||
@@ -300,6 +302,28 @@ class UserService
|
||||
$uinfo->mobile = $mobile;
|
||||
$uinfo->save();
|
||||
|
||||
$postOld = PostOld::where('mobile', $mobile)->get();
|
||||
if (!empty($postOld)) {
|
||||
foreach ($postOld as $item) {
|
||||
$post = [
|
||||
"id" => $item->id,
|
||||
"user_id" => $uinfo->id,
|
||||
"category_id" => $item->id,
|
||||
"sku_id" => $item->sku_id,
|
||||
"content" => $item->content,
|
||||
"shop_name" => $item->shop_name,
|
||||
"location_name" => $item->location_name,
|
||||
"status" => 1,
|
||||
"is_free" => $item->is_free,
|
||||
"model" => $item->model,
|
||||
"browse" => $item->browse,
|
||||
"price" => $item->price,
|
||||
"age" => $item->age,
|
||||
];
|
||||
Post::firstOrCreate($post);
|
||||
}
|
||||
}
|
||||
|
||||
return $wxinfo;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user