如果使用mysql mariadb,column1中的key1等于value1,而column2中的key2等于value2,如何在两列中搜索?

omqzjyyz  于 2021-06-17  发布在  Mysql
关注(0)|答案(1)|浏览(351)

一柱工程

whereJsonContains('VehicleApplications'
        ,['ModelName' => $model, 'YearID' => $year] )->paginate(10);
hc2pp10m

hc2pp10m1#

如果有人知道有更干净的查询,请确保定义变量类型

$make       = (string) $make;
    $model      = (string) $model;
    $year       = (int) $year;
    $category   = (int) $category;

    whereJsonContains('VehicleApplications',
        ['ModelName' => $model, 'YearID' => $year]
    )->
    whereJsonContains('pcItems',
        ['pcCategoryID' => $category]
    )->paginate(10);

相关问题