求各位前輩幫看看這個為什麼指定別名會自動加上表字首啊
在模型裡我加上了
protected $table = ‘platform_game’;
$game_list = Db::table('platform_game a')
->select(['a.id,a.name,a.name_en,a.name_path,b.thumb_img,list_order'])
->leftJoin('platform_game_extension b FORCE INDEX(index_game_id)', 'a.id','=','b.game_id')
->where($where)
->where("find_in_set($service_id, class_type)")
->orderBy('a.recommend','desc')
->orderBy('a.list_order','desc')
->limit(4)
->dd();
實際sql列印:
select `jc_a`.`id,a`.`name,a`.`name_en,a`.`name_path,b`.`thumb_img,list_order` from `jc_platform_game a` left join `jc_platform_game_extension b FORCE INDEX(index_game_id)` on `jc_a`.`id` = `jc_b`.`game_id` where (`jc_a`.`parent_id` = ? and `is_show` = ?) and `find_in_set(1, class_type)` is null order by `jc_a`.`recommend` desc, `jc_a`.`list_order` desc limit 4
本作品採用《CC 協議》,轉載必須註明作者和本文連結