|
|
@ -0,0 +1,17 @@ |
|
|
|
|
|
<?php |
|
|
|
|
|
|
|
|
|
|
|
namespace App\Http\Controllers\Api; |
|
|
|
|
|
use App\Http\Controllers\Controller; |
|
|
|
|
|
use App\Models\Category; |
|
|
|
|
|
|
|
|
|
|
|
class CategoryController extends Controller |
|
|
|
|
|
{ |
|
|
|
|
|
public function index() |
|
|
|
|
|
{ |
|
|
|
|
|
$list = Category::query() |
|
|
|
|
|
->where('agent_id', $this->agent_id) |
|
|
|
|
|
->orderBy('sort') |
|
|
|
|
|
->get(['id', 'name']); |
|
|
|
|
|
return $this->success($list); |
|
|
|
|
|
} |
|
|
|
|
|
} |