$params['name'], 'introduction' => $params['introduction'], 'phone' => $params['phone'], 'detailed_address' => $params['detailed_address'], 'image' => $params['image'], 'is_show' => $params['is_show'] ]); Db::commit(); return true; } catch (\Exception $e) { Db::rollback(); self::setError($e->getMessage()); return false; } } /** * @notes 编辑门店列表 * @param array $params * @return bool * @author admin * @date 2024/05/31 17:45 */ public static function edit(array $params): bool { Db::startTrans(); try { SystemStore::where('id', $params['id'])->update([ 'name' => $params['name'], 'introduction' => $params['introduction'], 'phone' => $params['phone'], 'detailed_address' => $params['detailed_address'], 'image' => $params['image'], 'latitude' => $params['latitude'], 'longitude' => $params['longitude'], 'is_show' => $params['is_show'] ]); Db::commit(); return true; } catch (\Exception $e) { Db::rollback(); self::setError($e->getMessage()); return false; } } /** * @notes 删除门店列表 * @param array $params * @return bool * @author admin * @date 2024/05/31 17:45 */ public static function delete(array $params): bool { return SystemStore::destroy($params['id']); } /** * @notes 获取门店列表详情 * @param $params * @return array * @author admin * @date 2024/05/31 17:45 */ public static function detail($params): array { return SystemStore::findOrEmpty($params['id'])->toArray(); } }