use think\Model;
collection()->toArray();
$result = collection(model("Menu")->order("listorder asc,id asc")->select())->toArray();


或是在模型里写
namespace app\admin\model;

class Menu extends \think\Model
{
protected $resultSetType = 'collection';
}

控制器
$result = model("Menu")->order("listorder asc,id asc")->select()->toArray();

  

参考tp5官方网站论坛:http://www.thinkphp.cn/topic/47321.html

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-12-12
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案