调整地区
This commit is contained in:
@@ -6,7 +6,6 @@ use App\Api\Controllers\Controller;
|
||||
use App\Api\Resources\Area\AreaCodeCollection;
|
||||
use App\Api\Resources\Area\AreaResource;
|
||||
use App\Models\Area;
|
||||
use App\Models\AreaCode;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Illuminate\Http\Request;
|
||||
use Jason\Api\Api;
|
||||
@@ -24,9 +23,10 @@ class IndexController extends Controller
|
||||
{
|
||||
$user = Api::user();
|
||||
$areas = Area::query()
|
||||
->whereHas('areaClerks', function ($q) {
|
||||
$q->where('user_id', Api::userId());
|
||||
})
|
||||
->Manager(Api::userId())
|
||||
// ->whereHas('areaClerks', function ($q) {
|
||||
// $q->where('user_id', Api::userId());
|
||||
// })
|
||||
->get();
|
||||
|
||||
return $this->success(AreaResource::collection($areas));
|
||||
@@ -42,9 +42,7 @@ class IndexController extends Controller
|
||||
public function show()
|
||||
{
|
||||
$area = Area::query()
|
||||
->whereHas('areaClerks', function ($q) {
|
||||
$q->where('user_id', Api::userId());
|
||||
})
|
||||
->Manager(Api::userId())
|
||||
->first();
|
||||
|
||||
if (! $area) {
|
||||
@@ -80,9 +78,7 @@ class IndexController extends Controller
|
||||
$status = $request->status ?? '';
|
||||
|
||||
$area = Area::query()
|
||||
->whereHas('areaClerks', function ($q) {
|
||||
$q->where('user_id', Api::userId());
|
||||
})
|
||||
->Manager(Api::userId())
|
||||
->first();
|
||||
if (! $area) {
|
||||
return $this->failed('您没有管理的区域无法查看');
|
||||
@@ -109,9 +105,7 @@ class IndexController extends Controller
|
||||
public function generate(Request $request)
|
||||
{
|
||||
$area = Area::query()
|
||||
->whereHas('areaClerks', function ($q) {
|
||||
$q->where('user_id', Api::userId());
|
||||
})
|
||||
->Manager(Api::userId())
|
||||
->first();
|
||||
if (! $area) {
|
||||
return $this->failed('您没有管理的区域无法查看');
|
||||
|
||||
Reference in New Issue
Block a user