|
@@ -21,11 +21,20 @@ class Goodup
|
|
|
$i = 0;
|
|
|
Db::startTrans();
|
|
|
try {
|
|
|
+
|
|
|
+ $all_list = Db::name("platform_youzan")
|
|
|
+ ->where(["platform_id" => $data['platform_id'], "is_del" => PlatformYouzan::$del_normal])
|
|
|
+ ->whereIn('spuCode', array_column($data['good_data'], 'spuCode'))
|
|
|
+ ->column('id,exam_status', 'spuCode');
|
|
|
+
|
|
|
foreach ($data['good_data'] as $value) {
|
|
|
- $count = Db::name("good_nake")->where(["spuCode" => $value['spuCode'], "is_del" => 0])->count();
|
|
|
- $ist = Db::name("good_platform")->where(["spuCode" => $value['spuCode'], "platform_code" => $data['platform_id'], "is_del" => 0])->find();
|
|
|
+// $count = Db::name("good_nake")->where(["spuCode" => $value['spuCode'], "is_del" => 0])->count();
|
|
|
+ $ist = isset($all_list[$value['spuCode']]) ? $all_list[$value['spuCode']] : [];
|
|
|
if ($ist) {
|
|
|
- $god = Db::name("good_basic")->where(["spuCode" => $value['spuCode'], "is_del" => 0])->find();
|
|
|
+ $god = Db::name("good_basic")
|
|
|
+ ->field('id,good_name,good_thumb_img')
|
|
|
+ ->where(["spuCode" => $value['spuCode'], "is_del" => 0])
|
|
|
+ ->find();
|
|
|
if ($god) {
|
|
|
$tp = [];
|
|
|
$tp['spuCode'] = $value['spuCode'];
|