sql语句:select user.*, @rownum:=@rownum+1 as 序号 from user,(SELECT @rownum:=0) r where status = 2 and id in (28, 29, 30, 31, 32, 26) order by id asc
php代码:
$data = User::from('movie')->where('status', 2)
->whereIn('id', $category_ids)
->orderBy('id', 'ASC')
->select('user.*')
->get()->toArray();
在php代码中添加上面sql语句的自增字段,怎么添加