|
@@ -140,7 +140,7 @@ class Cate extends Base{
|
|
|
$add=array_diff($param["specs_id"],$data->specs->column("specs_id"));
|
|
|
$delte=$data->specs()->whereNotIn("specs_id",$param["specs_id"])->save(["is_del"=>1]);
|
|
|
if($delte===false)return error("删除失败");
|
|
|
- $spec=$data->specs()->saveAll($add);
|
|
|
+ $spec=$data->specs()->saveAll(array_map(function($item){return ["specs_id"=>$item];},$add));
|
|
|
if($spec->isEmpty())return error("添加失败");
|
|
|
$this->model->commit();
|
|
|
}catch (\Exception $e){
|