|
|
@ -373,8 +373,11 @@ class Store extends Controller |
|
|
|
* @param int $storeId [description] |
|
|
|
* @param int $storeId [description] |
|
|
|
* @return [type] [description] |
|
|
|
* @return [type] [description] |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public function deleteGoods(int $storeId): Json |
|
|
|
public function deleteGoods(): Json |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
$params = $this->postData(); |
|
|
|
|
|
|
|
$storeId = $params['storeId'] ?? 0; |
|
|
|
|
|
|
|
$type = $params['type'] ?? 0; |
|
|
|
ini_set('memory_limit', '1024M'); |
|
|
|
ini_set('memory_limit', '1024M'); |
|
|
|
set_time_limit(0); |
|
|
|
set_time_limit(0); |
|
|
|
$model = StoreModel::detail($storeId); |
|
|
|
$model = StoreModel::detail($storeId); |
|
|
@ -383,11 +386,12 @@ class Store extends Controller |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//删除分类 |
|
|
|
//删除分类 |
|
|
|
|
|
|
|
if ($type == "cate") { |
|
|
|
Category::where('store_id', $storeId)->delete(); |
|
|
|
Category::where('store_id', $storeId)->delete(); |
|
|
|
// GoodsSku::where('store_id', $storeId)->delete(); |
|
|
|
return $this->renderSuccess(); |
|
|
|
// GoodsImage::where('store_id', $storeId)->delete(); |
|
|
|
} |
|
|
|
// GoodsSpecRel::where('store_id', $storeId)->delete(); |
|
|
|
|
|
|
|
// GoodsModel::where('store_id', $storeId)->delete(); |
|
|
|
if ($type == "goods") { |
|
|
|
$page = 1; |
|
|
|
$page = 1; |
|
|
|
while (TRUE) { |
|
|
|
while (TRUE) { |
|
|
|
//echo $page.PHP_EOL; |
|
|
|
//echo $page.PHP_EOL; |
|
|
@ -426,6 +430,8 @@ class Store extends Controller |
|
|
|
} |
|
|
|
} |
|
|
|
//删除商品 |
|
|
|
//删除商品 |
|
|
|
GoodsModel::where('store_id', $storeId)->where('channel','<>', 'zy')->delete(); |
|
|
|
GoodsModel::where('store_id', $storeId)->where('channel','<>', 'zy')->delete(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return $this->renderSuccess(); |
|
|
|
return $this->renderSuccess(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|