$data['first_responsible_person'], 'responsible_person' => $data['responsible_person'], 'platform' => $data['platform'], 'company_name' => $data['company_name'], 'product_name' => $data['product_name'], 'product_specs' => $data['product_specs'], 'suggested_price' => $data['suggested_price'], 'online_posting_price' => $data['online_posting_price'], 'online_posting_cunt' => $data['online_posting_cunt'], 'link_url' => $data['link_url'], 'store_name' => $data['store_name'], 'source_responsible_person' => $data['source_responsible_person'], 'processing_status' => '1', 'insert_time' => time(), ]; $ControlGoods_id = $this->insertGetId($insert_data); return $ControlGoods_id; } /** * 写入数据 * @author 唐远望 * @version 1.0 * @date 2025-12-09 * @param $data * @return bool */ public function addControlGoods($data) { DB::beginTransaction(); try { $this->addControlGoods_content($data); DB::commit(); return true; // 成功处理... } catch (\Exception $e) { DB::rollBack(); // 错误处理... return false; } } /** * 编辑内容 * @author 唐远望 * @version 1.0 * @date 2025-12-09 * @param $data * @return bool */ public function editControlGoods_content($where, $data) { $ControlGoods = $this->where($where)->first(); if (!$ControlGoods) { return false; } $ControlGoods->first_responsible_person = $data['first_responsible_person']; $ControlGoods->responsible_person = $data['responsible_person']; $ControlGoods->platform = $data['platform']; $ControlGoods->company_name = $data['company_name']; $ControlGoods->product_name = $data['product_name']; $ControlGoods->product_specs = $data['product_specs']; $ControlGoods->suggested_price = $data['suggested_price']; $ControlGoods->online_posting_price = $data['online_posting_price']; $ControlGoods->online_posting_cunt = $data['online_posting_cunt']; $ControlGoods->link_url = $data['link_url']; $ControlGoods->store_name = $data['store_name']; $ControlGoods->source_responsible_person = $data['source_responsible_person']; $ControlGoods->update_time = time(); $ControlGoods->save(); return true; } /** * 更新数据 * @author 唐远望 * @version 1.0 * @date 2025-12-09 * @param $data * @return bool */ public function updateControlGoods($where, $data) { DB::beginTransaction(); try { $this->editControlGoods_content($where, $data); DB::commit(); return true; // 成功处理... } catch (\Exception $e) { DB::rollBack(); // 错误处理... return false; } } /** * 修改状态 * @author 唐远望 * @version 1.0 * @date 2025-12-09 * @param $id * @param $status * @return bool */ public function changeStatus($where, $status) { $ControlGoods = $this->where($where)->first(); if (!$ControlGoods) { return false; } $ControlGoods->status = $status; $ControlGoods->update_time = time(); $ControlGoods->save(); return true; } /** * 修改处理状态 * @author 唐远望 * @version 1.0 * @date 2025-12-09 * @param $id * @param $processing_status * @return bool */ public function changeProcessingStatus($where, $processing_status) { $ControlGoods = $this->where($where)->first(); if (!$ControlGoods) { return false; } $ControlGoods->processing_status = $processing_status; $ControlGoods->update_time = time(); $ControlGoods->save(); return true; } /** * 删除数据 * @author 唐远望 * @version 1.0 * @date 2025-12-09 * @param $id * @return bool */ public function deleteControlGoods($where) { $ControlGoods = $this->where($where)->first(); if (!$ControlGoods) { return false; } $ControlGoods->delete(); return true; } }