如何在 laravel 中进行此查询
SELECT count(*)
FROM (SELECT *
FROM REPORT_INBOUND
WHERE ul_success_inbound = 0
AND moc_voice_records = 0
AND regdate = '2019-06-13')
WHERE gprs_records = 0
AND moc_sms_records = 0;
我在 laravel 中写了这个查询
$moc = DB::table('REPORT_INBOUND')
->select('REPORT_INBOUND.*',
DB::raw("select *
from REPORT_INBOUND
where UL_SUCCESS_INBOUND = 0
and MOC_VOICE_RECORDS = 0"))
->where([['gprs_records', '=', 0], ['moc_sms_records', '=', 0]]);
但它退回了它。我认为这是错误的结果
{"connection":{},"grammar":{},"processor":{},"bindings":{"select":[],"join":[],"where":[0,0],"having":[],"order":[],"union":[]},"aggregate":null,"columns":["REPORT_INBOUND.*",{}],"distinct":false,"from":"REPORT_INBOUND","joins":null,"wheres":[{"type":"Nested","query":{"connection":{},"grammar":{},"processor":{},"bindings":{"select":[],"join":[],"where":[0,0],"having":[],"order":[],"union":[]},"aggregate":null,"columns":null,"distinct":false,"from":"REPORT_INBOUND","joins":null,"wheres":[{"type":"Basic","column":"gprs_records","operator":"=","value":0,"boolean":"and"},{"type":"Basic","column":"moc_sms_records","operator":"=","value":0,"boolean":"and"}],"groups":null,"havings":null,"orders":null,"limit":null,"offset":null,"unions":null,"unionLimit":null,"unionOffset":null,"unionOrders":null,"lock":null,"operators":["=","<",">","<=",">=","<>","!=","<=>","like","like binary","not like","ilike","&","|","^","<<",">>","rlike","regexp","not regexp","~","~*","!~","!~*","similar to","not similar to","not ilike","~~*","!~~*"],"useWritePdo":false},"boolean":"and"}],"groups":null,"havings":null,"orders":null,"limit":null,"offset":null,"unions":null,"unionLimit":null,"unionOffset":null,"unionOrders":null,"lock":null,"operators":["=","<",">","<=",">=","<>","!=","<=>","like","like binary","not like","ilike","&","|","^","<<",">>","rlike","regexp","not regexp","~","~*","!~","!~*","similar to","not similar to","not ilike","~~*","!~~*"],"useWritePdo":false}