$data['store_name'], 'company_name' => $data['company_name'], 'social_credit_code' => $data['social_credit_code'], 'store_type' => $data['store_type'], 'insert_time' => time(), ]; $ViolationStore_id = $this->insertGetId($insert_data); return $ViolationStore_id; } /** * 写入数据 * @author 唐远望 * @version 1.0 * @date 2025-12-03 * @param $data * @return bool */ public function addViolationStore($data) { DB::beginTransaction(); try { $this->addViolationStore_content($data); DB::commit(); return true; // 成功处理... } catch (\Exception $e) { DB::rollBack(); // 错误处理... return false; } } /** * 编辑内容 * @author 唐远望 * @version 1.0 * @date 2025-12-03 * @param $data * @return bool */ public function editViolationStore_content($where, $data) { $ViolationStore = $this->where($where)->first(); if (!$ViolationStore) { return false; } $ViolationStore->store_name = $data['store_name']; $ViolationStore->company_name = $data['company_name']; $ViolationStore->social_credit_code = $data['social_credit_code']; $ViolationStore->store_type = $data['store_type']; $ViolationStore->update_time = time(); $ViolationStore->save(); return true; } /** * 更新数据 * @author 唐远望 * @version 1.0 * @date 2025-12-03 * @param $data * @return bool */ public function updateViolationStore($where, $data) { DB::beginTransaction(); try { $this->editViolationStore_content($where, $data); DB::commit(); return true; // 成功处理... } catch (\Exception $e) { DB::rollBack(); // 错误处理... return false; } } /** * 修改状态 * @author 唐远望 * @version 1.0 * @date 2025-12-03 * @param $id * @param $status * @return bool */ public function changeStatus($where, $status) { $ViolationStore = $this->where($where)->first(); if (!$ViolationStore) { return false; } $ViolationStore->status = $status; $ViolationStore->update_time = time(); $ViolationStore->save(); return true; } /** * 删除数据 * @author 唐远望 * @version 1.0 * @date 2025-12-03 * @param $id * @return bool */ public function deleteViolationStore($where) { $ViolationStore = $this->where($where)->first(); if (!$ViolationStore) { return false; } $ViolationStore->delete(); return true; } }