修复错误
This commit is contained in:
parent
f21e4de511
commit
395492c7b7
@ -2507,16 +2507,6 @@ class StoreOrderRepository extends BaseRepository
|
||||
$data = SpreadsheetExcelService::instance()->_import($arrary['path'], $arrary['sql'], $arrary['where'], 1);
|
||||
if (!$data) return false;
|
||||
unset($data[0]);
|
||||
// $mer_cate_id = Db::name('store_category')->where('mer_id', $merId)->where('cate_name', '默认分类')->value('store_category_id');
|
||||
// if (!$mer_cate_id || $mer_cate_id == 0) {
|
||||
// $mer_cate = ['pid' => 0, 'cate_name' => '默认分类', 'path' => '/', 'mer_id' => $merId, 'sort' => 0, 'is_show' => 1, 'create_time' => date('Y-m-d H:i:s')];
|
||||
// $mer_cate_id = Db::name('store_category')->insertGetId($mer_cate);
|
||||
// $mer_cate['pid'] = $mer_cate_id;
|
||||
// $mer_cate['path'] = '/' . $mer_cate_id . '/';
|
||||
// $mer_cate['level'] = 1;
|
||||
// $mer_cate_id = Db::name('store_category')->insertGetId($mer_cate);
|
||||
// }
|
||||
// $typeCode = Db::name('merchant_type')->where('mer_type_id', $merId)->value('type_code');
|
||||
$product_type = 0;
|
||||
if ($type_id == 12) {
|
||||
$product_type = 98; //供应链
|
||||
@ -2640,6 +2630,10 @@ class StoreOrderRepository extends BaseRepository
|
||||
0 => "https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/luzhou/static4/oa_app/23565656.png",
|
||||
];
|
||||
}
|
||||
$procure_price=0;
|
||||
if(!empty($datum['value']['procure_price'])){
|
||||
$procure_price=$datum['value']['procure_price'];
|
||||
}
|
||||
$datas = [
|
||||
"image" => $image,
|
||||
"slider_image" => $slider_image,
|
||||
@ -2684,7 +2678,7 @@ class StoreOrderRepository extends BaseRepository
|
||||
"cost" => $datum['value']['cost'],
|
||||
"ot_price" => $datum['value']['price'],
|
||||
"svip_price" => null,
|
||||
"procure_price" => $datum['value']['procure_price'] ?? 0,
|
||||
"procure_price" => $procure_price,
|
||||
"stock" => 1,
|
||||
"bar_code" => (int)$datum['value']['bar_code'],
|
||||
"weight" => 0,
|
||||
@ -2741,6 +2735,10 @@ class StoreOrderRepository extends BaseRepository
|
||||
|
||||
public function create_product_attr_value($find, $datum, $product_type, $attr_values, $merId, $sku)
|
||||
{
|
||||
$procure_price=0;
|
||||
if(!empty($datum['value']['procure_price'])){
|
||||
$procure_price=$datum['value']['procure_price'];
|
||||
}
|
||||
$attrValue['stock'] = 1;
|
||||
$unique = app(ProductRepository::class)->setUnique($find['product_id'], $datum['value']['bar_code'], $product_type);
|
||||
$attrValue['unique'] = $unique;
|
||||
@ -2751,7 +2749,7 @@ class StoreOrderRepository extends BaseRepository
|
||||
$attrValue['cost'] = $datum['value']['cost'];
|
||||
$attrValue['ot_price'] = $datum['value']['price'];
|
||||
$attrValue['price'] = $datum['value']['price'];
|
||||
$attrValue['procure_price'] = $datum['value']['procure_price'];
|
||||
$attrValue['procure_price'] = $procure_price;
|
||||
$attrValue["image"] = "https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/luzhou/static4/oa_app/23565656.png";
|
||||
Db::name('store_product_attr_value')->insert($attrValue);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user