我用model時(shí)候,get()方法可以,但是all()方法不可以!
<?php
namespace app\index\controller;
use think\Controller;
use app\index\model\Swiperlist;
class Index
{
? ??
? ? public function swiperList()
? ? {
? ? ?
? ? ?//? $where = function($query){
? ? ? ? // $query->field(['id','imgUrl','swiperUrl'])->where('isSwiper','=','1');
? ? ? // };
? ? ? ?$res = Swiperlist::all();
? ? ?
? ? ? ?return $res;
? ? ??
? ? }
2022-08-31
這個(gè)用法都不同的
2021-07-28
all要等所有都完成之后回調(diào)