|
|
|
@ -3,6 +3,7 @@ |
|
|
|
namespace App\Http\Controllers\Api; |
|
|
|
use App\Http\Controllers\Controller; |
|
|
|
use App\Models\Slide; |
|
|
|
use Illuminate\Support\Facades\DB; |
|
|
|
|
|
|
|
//轮播图
|
|
|
|
class SlideController extends Controller |
|
|
|
@ -10,8 +11,10 @@ class SlideController extends Controller |
|
|
|
//轮播图列表
|
|
|
|
public function index() |
|
|
|
{ |
|
|
|
$list = Slide::where('agent_id', $this->agent_id)->where('status', 1) |
|
|
|
->orderBy('sort')->orderBy('id', 'DESC')->limit(10)->get(['title','url']); |
|
|
|
$list = Slide::where(['agent_id' => $this->agent_id, 'status' => 1]) |
|
|
|
->orderBy(DB::raw('sort ASC, id DESC')) |
|
|
|
->limit(10) |
|
|
|
->get(['title','picture', 'type', 'url']); |
|
|
|
return $this->success($list); |
|
|
|
} |
|
|
|
} |