|
@@ -223,6 +223,36 @@ class Goodup
|
|
|
}
|
|
|
|
|
|
|
|
|
+ //有赞商品重新上线(上线失败的、下线后又重新上线的)
|
|
|
+ public static function goodupOnlineAgain(int $platform_youzan_id = 0, string $token = '')
|
|
|
+ {
|
|
|
+
|
|
|
+ $db = new PlatformYouzan();
|
|
|
+
|
|
|
+ $rs = $db
|
|
|
+ ->field('id')
|
|
|
+ ->where(['id' => $platform_youzan_id, 'is_del' => $db::$del_normal])
|
|
|
+ ->whereIn('exam_status', [$db::$exam_status_7, $db::$exam_status_8])
|
|
|
+ ->findOrEmpty();
|
|
|
+
|
|
|
+ if ($rs->isEmpty()) return error_show(1005, '该商品上线记录不存在或不允许重新上线');
|
|
|
+
|
|
|
+ $userinfo = GetUserInfo($token);
|
|
|
+
|
|
|
+ //更新
|
|
|
+ $res = $db->where('id', $platform_youzan_id)
|
|
|
+ ->save([
|
|
|
+ 'exam_status' => $db::$exam_status_0,
|
|
|
+ 'updaterid' => isset($userinfo['data']['id']) ? $userinfo['data']['id'] : 0,
|
|
|
+ 'updater' => isset($userinfo['data']['nickname']) ? $userinfo['data']['nickname'] : '',
|
|
|
+ 'updatetime' => date('Y-m-d H:i:s'),
|
|
|
+ ]);
|
|
|
+
|
|
|
+ return $res ? app_show(0, '操作成功') : error_show(1005, '重新发起上线失败');
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
//商品上线详情
|
|
|
public static function getYzGoodupInfo(int $platform_youzan_id = 0)
|
|
|
{
|
|
@@ -235,7 +265,7 @@ class Goodup
|
|
|
|
|
|
$good_data = Db::name("good")
|
|
|
->withoutField('createrid,creater,is_del,addtime,updatetime')
|
|
|
- ->where(["is_del" => 0,"spuCode" => $data['spuCode']])
|
|
|
+ ->where(["is_del" => 0, "spuCode" => $data['spuCode']])
|
|
|
->find();
|
|
|
if ($good_data == false) return error_show(1004, "未找到商品数据");
|
|
|
|