|
@@ -1,6 +1,7 @@
|
|
<?php
|
|
<?php
|
|
namespace App\Repositories;
|
|
namespace App\Repositories;
|
|
use App\Models\Floor;
|
|
use App\Models\Floor;
|
|
|
|
+use App\Traits\UserTrait;
|
|
use Illuminate\Support\Facades\Log;
|
|
use Illuminate\Support\Facades\Log;
|
|
use Symfony\Component\HttpKernel\Exception\HttpException;
|
|
use Symfony\Component\HttpKernel\Exception\HttpException;
|
|
use Dingo\Api\Http\Response;
|
|
use Dingo\Api\Http\Response;
|
|
@@ -16,6 +17,7 @@ use Illuminate\Database\QueryException;
|
|
|
|
|
|
class FloorRepository
|
|
class FloorRepository
|
|
{
|
|
{
|
|
|
|
+ use UserTrait;
|
|
public function __construct(Floor $floor)
|
|
public function __construct(Floor $floor)
|
|
{
|
|
{
|
|
$this->floor = $floor;
|
|
$this->floor = $floor;
|
|
@@ -30,5 +32,30 @@ class FloorRepository
|
|
return $this->floor->where($where)->orderBy('floor_location', 'asc')->paginate($perPage);
|
|
return $this->floor->where($where)->orderBy('floor_location', 'asc')->paginate($perPage);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ public function info()
|
|
|
|
+ {
|
|
|
|
+ $userInfo = $this->getUserInfo();
|
|
|
|
+ if(!$userInfo){
|
|
|
|
+ return jsonError('获取用户信息失败');
|
|
|
|
+ }
|
|
|
|
+ return $floor = $this->floor
|
|
|
|
+ ->where('is_open', 1)
|
|
|
|
+ ->whereIn('floor_type', [0,1,2,3])
|
|
|
|
+ ->whereBetween('floor_location', [1,20])
|
|
|
|
+ ->get();
|
|
|
|
+ $data = [];
|
|
|
|
+ foreach($floor as $item){
|
|
|
|
+ if($item->floor_type == 0){
|
|
|
|
+ //banner
|
|
|
|
+ }elseif($item->floor_type == 1){
|
|
|
|
+ //user
|
|
|
|
+ }elseif($item->floor_type == 2){
|
|
|
|
+ //video
|
|
|
|
+ }elseif($item->floor_type == 3){
|
|
|
|
+ //topic
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|