|
@@ -177,6 +177,7 @@ class Goodup
|
|
|
'post_fee' => $post_fee,
|
|
|
'desc' => $rs->good_remark,//商品描述
|
|
|
'good_ladder_id' => $data['good_ladder_id'],
|
|
|
+ 'tags' => implode(',', $data['tags']),
|
|
|
]);
|
|
|
|
|
|
//调有赞项目的接口,从有赞平台下线该商品
|
|
@@ -202,6 +203,7 @@ class Goodup
|
|
|
'sell_point' => '',//商品卖点信息
|
|
|
'yz_cat_id' => $data['yz_cat_id'],//有赞类目id
|
|
|
'start_sale_num' => $data['start_sale_num'],//商品起售数,默认为1
|
|
|
+ 'tags' => $data['tags'],//标签id,多个以,分割
|
|
|
];
|
|
|
$host = config('app.yz_domain');
|
|
|
$response = curl_request($host . 'api/yz_goodup', $curl_data);
|
|
@@ -401,7 +403,7 @@ class Goodup
|
|
|
->findOrEmpty();
|
|
|
|
|
|
if ($rs->isEmpty()) throw new Exception('该记录不存在');
|
|
|
- if ($rs->exam_status != $db::$exam_status_6) throw new Exception('该商品尚未上线');
|
|
|
+ if ($rs->exam_status == $db::$exam_status_8) throw new Exception('该商品已下线,无法重复下线');
|
|
|
|
|
|
$userinfo = GetUserInfo($data['token']);
|
|
|
|
|
@@ -411,19 +413,22 @@ class Goodup
|
|
|
'nickname' => isset($userinfo['data']['nickname']) ? $userinfo['data']['nickname'] : '',
|
|
|
];
|
|
|
|
|
|
- //调有赞项目的接口,从有赞平台下线该商品
|
|
|
- $host = config('app.yz_domain');
|
|
|
- $response = curl_request($host . 'api/yz_goodup_offline', $curl_data);
|
|
|
+ if ($rs->exam_status == $db::$exam_status_6) {
|
|
|
+ //已上线的要调用有赞接口下线
|
|
|
+ //调有赞项目的接口,从有赞平台下线该商品
|
|
|
+ $host = config('app.yz_domain');
|
|
|
+ $response = curl_request($host . 'api/yz_goodup_offline', $curl_data);
|
|
|
|
|
|
- $response = json_decode($response, true);
|
|
|
+ $response = json_decode($response, true);
|
|
|
|
|
|
- if ($response['code'] != 0) throw new Exception($response['message']);
|
|
|
+ if ($response['code'] != 0) throw new Exception($response['message']);
|
|
|
+ }
|
|
|
|
|
|
$db::where('id', $platform_youzan_id)
|
|
|
->update([
|
|
|
'exam_status' => $db::$exam_status_8,
|
|
|
- 'offline_reason_id'=>$data['offline_reason_id'],
|
|
|
- 'offline_remark'=>$data['offline_remark'],
|
|
|
+ 'offline_reason_id' => $data['offline_reason_id'],
|
|
|
+ 'offline_remark' => $data['offline_remark'],
|
|
|
'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')
|
|
@@ -440,7 +445,6 @@ class Goodup
|
|
|
|
|
|
}
|
|
|
|
|
|
-
|
|
|
//有赞下线商品列表
|
|
|
public static function youzanOfflineList(array $data = [])
|
|
|
{
|
|
@@ -450,13 +454,13 @@ class Goodup
|
|
|
|
|
|
$count = Db::name('platform_youzan')
|
|
|
->alias('pyz')
|
|
|
- ->leftJoin('good g','g.spuCode=pyz.spuCode')
|
|
|
+ ->leftJoin('good g', 'g.spuCode=pyz.spuCode')
|
|
|
->where($where)
|
|
|
->count('pyz.id');
|
|
|
|
|
|
- $list = PlatformYouzan::field('pyz.id,pyz.id platform_youzan_id,pyz.spuCode,g.good_name,pyz.creater,pyz.updatetime')
|
|
|
+ $list = PlatformYouzan::field('pyz.id,pyz.id platform_youzan_id,pyz.spuCode,g.good_name,pyz.updater,pyz.updatetime')
|
|
|
->alias('pyz')
|
|
|
- ->leftJoin('good g','g.spuCode=pyz.spuCode')
|
|
|
+ ->leftJoin('good g', 'g.spuCode=pyz.spuCode')
|
|
|
->where($where)
|
|
|
->order('pyz.addtime', 'desc')
|
|
|
->page($data['page'], $data['size'])
|
|
@@ -467,15 +471,15 @@ class Goodup
|
|
|
|
|
|
}
|
|
|
|
|
|
- //有赞下线商品列表
|
|
|
+ //有赞下线商品详情
|
|
|
public static function youzanOfflineDetail(int $platform_youzan_id = 0)
|
|
|
{
|
|
|
$info = PlatformYouzan::where('pyz.id', $platform_youzan_id)
|
|
|
- ->field('pyz.*,g.good_name,r.result_desc,p.platform_name')
|
|
|
+ ->field('pyz.*,g.good_name,r.result,p.platform_name')
|
|
|
->alias('pyz')
|
|
|
- ->leftJoin('good g','g.spuCode=pyz.spuCode')
|
|
|
- ->leftJoin('result_info r','r.id=pyz.offline_reason_id')
|
|
|
- ->leftJoin('platform p','p.id=pyz.platform_id')
|
|
|
+ ->leftJoin('good g', 'g.spuCode=pyz.spuCode')
|
|
|
+ ->leftJoin('result_info r', 'r.result_code=pyz.offline_reason_id')
|
|
|
+ ->leftJoin('platform p', 'p.id=pyz.platform_id')
|
|
|
->findOrEmpty();
|
|
|
|
|
|
return app_show(0, "获取成功", $info);
|