|
|
|
|
@ -4,6 +4,7 @@ namespace App\Http\Controllers\Mobile;
|
|
|
|
|
|
|
|
|
|
use App\Helpers\ResponseCode;
|
|
|
|
|
use App\Helpers\StarterResponseCode;
|
|
|
|
|
use App\Models\Config;
|
|
|
|
|
use App\Models\User;
|
|
|
|
|
use App\Models\Visit;
|
|
|
|
|
use EasyWeChat\Factory;
|
|
|
|
|
@ -161,7 +162,7 @@ class UserController extends CommonController
|
|
|
|
|
public function myVisit()
|
|
|
|
|
{
|
|
|
|
|
$all = request()->all();
|
|
|
|
|
$list = Visit::with('logs.admin','logs.user', 'visitTime', 'admin', 'visitArea', 'acceptAdmin.department', 'acceptAdminSignFile', 'acceptGoodsAdmin.department')->where('user_id', $this->getUserId())
|
|
|
|
|
$list = Visit::with('logs.admin', 'logs.user', 'visitTime', 'admin', 'visitArea', 'acceptAdmin.department', 'acceptAdminSignFile', 'acceptGoodsAdmin.department')->where('user_id', $this->getUserId())
|
|
|
|
|
->where(function ($query) use ($all) {
|
|
|
|
|
if (isset($all['type'])) {
|
|
|
|
|
$query->where('type', $all['type']);
|
|
|
|
|
@ -197,8 +198,27 @@ class UserController extends CommonController
|
|
|
|
|
if ($validator->fails()) {
|
|
|
|
|
return $this->fail([ResponseCode::ERROR_PARAMETER, implode(',', $validator->errors()->all())]);
|
|
|
|
|
}
|
|
|
|
|
$detail = Visit::with('logs.admin','logs.user','visitTime', 'admin', 'visitArea', 'acceptAdmin.department', 'acceptAdminSignFile', 'acceptGoodsAdmin.department')->find($all['id']);
|
|
|
|
|
$detail = Visit::with('logs.admin', 'logs.user', 'visitTime', 'admin', 'visitArea', 'acceptAdmin.department', 'acceptAdminSignFile', 'acceptGoodsAdmin.department')->find($all['id']);
|
|
|
|
|
return $this->success($detail);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* @OA\Get(
|
|
|
|
|
* path="/api/mobile/user/config",
|
|
|
|
|
* tags={"小程序-用户管理"},
|
|
|
|
|
* summary="配置信息",
|
|
|
|
|
* description="",
|
|
|
|
|
* @OA\Parameter(name="token", in="query", @OA\Schema(type="string"), required=true, description="token"),
|
|
|
|
|
* @OA\Response(
|
|
|
|
|
* response="200",
|
|
|
|
|
* description="暂无"
|
|
|
|
|
* )
|
|
|
|
|
* )
|
|
|
|
|
*/
|
|
|
|
|
public function config()
|
|
|
|
|
{
|
|
|
|
|
$list = Config::get();
|
|
|
|
|
return $this->success($list);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|