|
|
@@ -278,6 +278,7 @@ class ViolationProduct extends Controller
|
|
|
if (!$ViolationProduct) {
|
|
|
return false;
|
|
|
}
|
|
|
+ $ViolationProduct_log = $ViolationProduct->toArray();
|
|
|
DB::beginTransaction();
|
|
|
try {
|
|
|
$ViolationProductCompanyModel = new ViolationProductCompanyModel();
|
|
|
@@ -285,13 +286,13 @@ class ViolationProduct extends Controller
|
|
|
if (!empty($company_id_log)) {
|
|
|
$ViolationProductCompanyModel->where('violation_product_logid', $ViolationProduct->id)->delete();
|
|
|
}
|
|
|
- $ViolationProduct->delete();
|
|
|
+ $ViolationProductModel->where($where)->delete();
|
|
|
// 记录行为
|
|
|
$admin_id = request('access_token.uid', 0); //用户ID
|
|
|
$is_admin = request('access_token.is_admin'); //是否管理员操作 0=是1=否
|
|
|
$table_name = $ViolationProductModel->getTable();
|
|
|
$notes_type = 3; //操作类型,1添加,2修改,3=删除
|
|
|
- $this->addAdminHistory('清洗配置-禁止商品管理', $admin_id, $is_admin, $is_admin, $table_name, $notes_type, $ViolationProduct->toarray(), [], '删除了禁止商品' . $ViolationProduct->product_name . '信息');
|
|
|
+ $this->addAdminHistory('清洗配置-禁止商品管理', $admin_id, $is_admin, $table_name, $notes_type,$ViolationProduct_log, [], '删除了禁止商品' . $ViolationProduct_log['product_name'] . '信息');
|
|
|
// 告知结果
|
|
|
DB::commit();
|
|
|
return json_send(['code' => 'success', 'msg' => '删除成功']);
|
|
|
@@ -299,7 +300,7 @@ class ViolationProduct extends Controller
|
|
|
} catch (\Exception $e) {
|
|
|
DB::rollBack();
|
|
|
// 错误处理...
|
|
|
- return json_send(['code' => 'error', 'msg' => '删除失败']);
|
|
|
+ return json_send(['code' => 'error', 'msg' => '删除失败','data' => $e->getMessage(),'k'=>$ViolationProduct_log]);
|
|
|
}
|
|
|
}
|
|
|
}
|