标签:lis asc style mod 官方网站 array use 控制 extends
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
标签:lis asc style mod 官方网站 array use 控制 extends
原文地址:https://www.cnblogs.com/yulongcode/p/11387341.html