我运行这个命令,我发现我在生产模式下工作:
php artisan env
Run Code Online (Sandbox Code Playgroud)
在我添加到我的 .env 这一行之后:
APP_ENV=development
Run Code Online (Sandbox Code Playgroud)
在我运行所有这些命令之后
php artisan cache:clear
php artisan view:clear
php artisan config:cache
Run Code Online (Sandbox Code Playgroud)
我总是得到生产模式
我正在尝试创建((Where and Where)OR(Where and Where))经过大量搜索,我发现了这一点
$last_transations = Transcationhistorique::where('sender_id', '=', $user_id)
->where('receiver_id','=', $user_id)
->orderBy('created_at', 'desc')
->skip(3)
->take(3)
->get();
Run Code Online (Sandbox Code Playgroud)
我得到一个空洞的结果
"最后3笔交易":[]
我将此代码添加到我的页面,当用户点击一个邮政编码并且我的警报不显示时,我想完成城市
var obj = {
"01400": "ABERGEMENT-CLÉMENCIAT",
"01640": "ABERGEMENT-DE-VAREY",
"01500": "AMBÉRIEU-EN-BUGEY",
"01330": "AMBÉRIEUX-EN-DOMBES",
"01300": "AMBLÉON",
"01500": "AMBRONAY",
"01500": "AMBUTRIX",
"01300": "ANDERT-ET-CONDON",
"01350": "ANGLEFORT",
"01100": "APREMONT",
"01110": "ARANC",
"01230": "ARANDAS",
"01100": "ARBENT",
"01300": "ARBIGNIEU",
"01190": "ARBIGNY"
};
var myVariable = obj .01400;
alert(myVariable);Run Code Online (Sandbox Code Playgroud)
我使用此查询,我收到一个错误:
$description = $request->get('description');
$description_query = Transcationhistorique::where(function ($query) use ($description, $user_id) {
$query->where('receiver_id', $user_id,'description', 'LIKE','%' . $description . '%')
->orWhere('description', 'LIKE','%' . $description . '%','sender_id', $user_id);
})->get();
Run Code Online (Sandbox Code Playgroud)
这是我得到的错误:
"SQLSTATE [42S22]:未找到列:1054'where 子句'中的未知列'0'(SQL:select*from
transcation_historiquewhere(sender_id= 32 and0=%salaire%and1= LIKE and2= description)orreceiver_id= 32)"
这就是我真正想要的:
select * from `transcation_historique` where (`sender_id` = 32 and `description` = %salaire%) or (`receiver_id` = 32 and `description` = %salaire%)
Run Code Online (Sandbox Code Playgroud)