修复
This commit is contained in:
parent
2f8dc934d5
commit
fa10cad90f
@ -136,17 +136,17 @@ class Demo extends BaseController
|
||||
Db::name('store_product')->where('product_id', $find['product_id'])->update($update);
|
||||
/**更新规格图片 */
|
||||
foreach ($sku_arr as $k => $v) {
|
||||
$sku = explode(',', $k);
|
||||
if(count($sku)==2){
|
||||
$sku_name=$sku[0];
|
||||
}else{
|
||||
continue;
|
||||
}
|
||||
$store_product_attr_value = Db::name('store_product_attr_value')->where(['mer_id' => $mer_id, 'product_id' => $find['product_id'], 'sku' => $sku_name])->find();
|
||||
// $sku = explode(',', $k);
|
||||
// if(count($sku)==2){
|
||||
// $sku_name=$sku[0];
|
||||
// }else{
|
||||
// continue;
|
||||
// }
|
||||
$store_product_attr_value = Db::name('store_product_attr_value')->where(['mer_id' => $mer_id, 'product_id' => $find['product_id'], 'sku' => $k])->find();
|
||||
if ($store_product_attr_value) {
|
||||
$oss = $upload->to($dir)->stream(file_get_contents($v));
|
||||
Db::name('store_product_attr_value')
|
||||
->where(['mer_id' => $mer_id, 'product_id' => $find['product_id'], 'sku' => $sku_name])
|
||||
->where(['mer_id' => $mer_id, 'product_id' => $find['product_id'], 'sku' => $k])
|
||||
->update(['image' => $oss->filePath]);
|
||||
}
|
||||
}
|
||||
|
@ -89,17 +89,17 @@ class ImportPicJob implements JobInterface
|
||||
Db::name('store_product')->where('product_id', $find['product_id'])->update($update);
|
||||
/**更新规格图片 */
|
||||
foreach ($sku_arr as $k => $v) {
|
||||
$sku = explode(',', $k);
|
||||
if(count($sku)==2){
|
||||
$sku_name=$sku[0];
|
||||
}else{
|
||||
continue;
|
||||
}
|
||||
$store_product_attr_value = Db::name('store_product_attr_value')->where(['mer_id' => $mer_id, 'product_id' => $find['product_id'], 'sku' => $sku_name])->find();
|
||||
// $sku = explode(',', $k);
|
||||
// if(count($sku)==2){
|
||||
// $sku_name=$sku[0];
|
||||
// }else{
|
||||
// continue;
|
||||
// }
|
||||
$store_product_attr_value = Db::name('store_product_attr_value')->where(['mer_id' => $mer_id, 'product_id' => $find['product_id'], 'sku' => $k])->find();
|
||||
if ($store_product_attr_value) {
|
||||
$oss = $upload->to($dir)->stream(file_get_contents($v));
|
||||
Db::name('store_product_attr_value')
|
||||
->where(['mer_id' => $mer_id, 'product_id' => $find['product_id'], 'sku' => $sku_name])
|
||||
->where(['mer_id' => $mer_id, 'product_id' => $find['product_id'], 'sku' => $k])
|
||||
->update(['image' => $oss->filePath]);
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user