0

我在数据库表中添加了两列,还在模型可填充属性中添加了这两列。


当我运行一条路线以查看结果时。它说未知列。实际上它存在于数据库表中。

我正在使用 Vue 项目开发 Laravel。现在面临部署问题。首先,当我将整个项目从本地机器上传到 Cpanel 时。一切正常。

但是,当后来我更改任何查询或其他内容时,它并没有反映在浏览器上。

我试图解决这个问题是什么?步骤一:移除缓存、视图、路由步骤二:在本地机器上 npm run dev 并将本地机器项目中的 public/js/app.js 上传到 Cpanel 项目的 public/js 目录。

将 app.js 上传到 Cpanel public/js 文件夹后,我再次运行缓存删除命令。但是没有变化反映。

我如何通过以下路线删除缓存:

use Illuminate\Support\Facades\Artisan;

Route::get("reboot",function (){
   Artisan::call('config:cache');
   Artisan::call('route:clear');
   Artisan::call('view:clear');
   Artisan::call('cache:clear');
   dd("Ready to Re-start");
});

API 响应错误:

 "message": "SQLSTATE[42S22]: Column not found: 1054 Unknown column 'start_timestamp' in 'where clause' (SQL: select count(*) as aggregate from `vehicle_prices` where `rental_duration_id` = 5 and `rate` between 0 and 55 and exists (select * from `vehicles` where `vehicle_prices`.`vehicle_id` = `vehicles`.`id` and exists (select * from `users` where `vehicles`.`partner_id` = `users`.`id` and `is_vehicle_release` = 1 and `status` = 1) and `service_id` = 1 and `status` = 1 and `passenger` >= 1 and `bag` >= 1 and exists (select * from `vehicle_cities` where `vehicles`.`id` = `vehicle_cities`.`vehicle_id` and (`country` = BD and `locality` = Dhaka or `additional_locality_1` = Dhaka or `additional_locality_2` = Dhaka or `additional_locality_3` = Dhaka or `additional_locality_4` = Dhaka) and `vehicle_cities`.`deleted_at` is null) and not exists (select * from `reservations` where `vehicles`.`id` = `reservations`.`vehicle_id` and ((`start_timestamp` between 2020-09-11 04:00:00 and 2020-09-11 08:43:00 or `end_timestamp` between 2020-09-11 04:00:00 and 2020-09-11 08:43:00) or (`start_timestamp` <= 2020-09-11 08:43:00 and `end_timestamp` >= 2020-09-11 04:00:00))) and `vehicles`.`deleted_at` is null) and exists (select * from `vehicles` where `vehicle_prices`.`vehicle_id` = `vehicles`.`id` and `vehicles`.`deleted_at` is null))",

数据库结构:

我的数据库表结构图像中存在 start_timestamp 和 end_timestamp

如何处理这个问题?

4

2 回答 2

0

npm run watch 命令将继续在您的终端中运行并监视所有相关文件的更改。然后,Webpack 将在检测到更改时自动重新编译您的资产:

npm 运行观察

于 2020-09-10T05:41:30.100 回答
0

如果在编译后看不到更改,则需要使用命令 npm run watch 观察更改,这意味着您的项目前端正在缓存,您可以指定编译文件的版本,从您将其包含在应用程序中的位置. 你可以这样做。

或者这样做,这样您就不会在更新时不断更改版本

于 2021-09-24T08:52:48.157 回答