更新报错

This commit is contained in:
shengchanzhe 2023-12-13 17:49:04 +08:00
parent bc548f2afa
commit d859876f71

View File

@ -321,7 +321,7 @@ class ProductRepository extends BaseRepository
} }
app()->make(SpuRepository::class)->changeStatus($id, $productType); app()->make(SpuRepository::class)->changeStatus($id, $productType);
Db::commit(); Db::commit();
return $res; return true;
} catch (\Exception $e) { } catch (\Exception $e) {
Db::rollback(); Db::rollback();
return false; return false;
@ -541,7 +541,7 @@ class ProductRepository extends BaseRepository
{ {
$result = []; $result = [];
foreach ($data as $value) { foreach ($data as $value) {
if ($value['category']) { if (is_int($value)||$value['category']) {
$result[] = [ $result[] = [
'product_id' => $productId, 'product_id' => $productId,
'mer_cate_id' => $value, 'mer_cate_id' => $value,