ThinkPHP6 orderRaw 自定义排序规则

∫`不撒娇的折耳猫 2021-8-10 1348

           $res = Db::table('wl_integral')
                ->alias('i')
                ->join('travel t','i.tid = t.id')
                ->field('i.id,i.item,i.file,i.rule_id,i.score,i.status,t.title')
                ->orderRaw('field(i.status,0,1,-1)')
                ->where($map)
                ->paginate($limit,false);


最新回复 (0)
发新帖