Php 没有错误结果的地方
我的php代码Php 没有错误结果的地方,php,laravel,Php,Laravel,我的php代码 $AllAdTypes = UserAdTypes::where('ad_id', $value) ->whereNotIn('ad_typeprice_id', array($ArrString[$i - 1])) ->orderby('created_at', 'ASC')->orderby('ad_id', 'ASC') ->select('ad_typeprice_id')->lists('ad
$AllAdTypes = UserAdTypes::where('ad_id', $value)
->whereNotIn('ad_typeprice_id', array($ArrString[$i - 1]))
->orderby('created_at', 'ASC')->orderby('ad_id', 'ASC')
->select('ad_typeprice_id')->lists('ad_typeprice_id');
$queries = DB::getQueryLog();
return $last_query = end($queries);
最后查询:
Array ( [query] => select `ad_typeprice_id` from `UserAdTypes` where `ad_id` = ?
and `ad_typeprice_id` not in (?) order by `created_at` asc, `ad_id` asc
[bindings] => Array ( [0] => 82 [1] => 4, 10, 18, 27, 36, 7, 16, 11, 21, 19, 12 )
[time] => 0.44 )
当我尝试使用sql时,一切正常
SELECT `ad_typeprice_id`
FROM `UserAdTypes`
WHERE `ad_id` =82
AND `ad_typeprice_id` NOT
IN ( 4, 10, 18, 27, 36, 7, 16, 11, 21, 19, 12 )
ORDER BY `created_at` ASC , `ad_id` ASC
LIMIT 0 , 30
SQL结果:13
但我不知道,这个疑问是对的。我在sql上进行了测试。结果是错误的
Laravel查询结果
Array ( [0] => 13 [1] => 18 [2] => 12 [3] => 19 )
如果您检查$last_查询结果,我只需要显示[0]=>13 $ArrString[$i-1]是字符串吗?如果是这样的话,您能将其设置为这些值的数组吗?现在,它可能不在'4,10,18,27,36,7,16,11,21,19,12'中注释引号。是返回字符串。4、10、18、27、36、7、16、11、21、19、12感谢我犯的错误: