第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定
已解決430363個(gè)問題,去搜搜看,總會(huì)有你想問的

LARAVEL 生產(chǎn)。錯(cuò)誤:SQLSTATE[42S22]:未找到列:1054 未知列

LARAVEL 生產(chǎn)。錯(cuò)誤:SQLSTATE[42S22]:未找到列:1054 未知列

PHP
倚天杖 2023-07-01 17:25:05
查詢時(shí),我想使用store_id而不是nd_001_store_id。我收到如下錯(cuò)誤 : Production.ERROR: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'store_id' in 'where Clause'$user_store_id = Session::get('user_store_id'); //for example 6$a = "2020-06-20 13:00:00";$b = "2020-07-05 13:00:00";$sales_types = ['retail', 'wholesale'];$invoice_items_stock_ids = InvoiceItems::select(    'nd_001_stock_id AS stock_id',    'nd_000_store_id AS store_id',    DB::raw("CONCAT(add_date_store, ' ', add_hours_store) AS date_range"))->where(function ($query) use ($user_store_id) {    $query->where('store_id', '=', $user_store_id);})->orWhere(function ($query) use ($a, $b) {    $query->where('date_range', '>=', $a)            ->where('date_range', '<=', $b);})->whereIn('type', $sales_types)->get();date_range 和 store_id 未找到列錯(cuò)誤謝謝,最誠(chéng)摯的問候
查看完整描述

1 回答

?
揚(yáng)帆大魚

TA貢獻(xiàn)1799條經(jīng)驗(yàn) 獲得超9個(gè)贊

請(qǐng)嘗試?whereRaw

$invoice_items_stock_ids = InvoiceItems::select(

? ? 'nd_001_stock_id AS stock_id',

? ? 'nd_000_store_id AS store_id',

? ? DB::raw("CONCAT(add_date_store, ' ', add_hours_store) AS date_range")

)->where(function ($query) use ($user_store_id) {

? ? $query->whereRaw('store_id', '=', $user_store_id);

})->orWhere(function ($query) use ($a, $b) {

? ? $query->whereRaw('date_range', '>=', $a)

? ? ? ? ? ? ->whereRaw('date_range', '<=', $b);

})

->whereIn('type', $sales_types)->get();


查看完整回答
反對(duì) 回復(fù) 2023-07-01
  • 1 回答
  • 0 關(guān)注
  • 200 瀏覽

添加回答

舉報(bào)

0/150
提交
取消
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)