【发布时间】:2020-12-28 09:38:56
【问题描述】:
我在数据库表中添加了两列,也在模型可填充属性中添加了这两列。
当我运行一条路线以查看结果时。它说未知列。实际上它存在于数据库表中。
我正在使用 Vue 项目开发 Laravel。 现在面临部署问题。 首先,当我将整个项目从本地机器上传到 Cpanel 时。一切正常。
但是,当我后来更改任何查询或其他内容时,它并没有反映在浏览器上。
我试图解决这个问题是什么? 第 1 步:删除缓存、视图、路由 第二步:在本机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))",
数据库结构:
如何处理这个问题?
【问题讨论】:
-
你有没有试过给表加别名,你的问题好像是列不明确。
标签: laravel laravel-vue