xiaogang 3 年之前
父節點
當前提交
8fb23fa7f4
共有 3 個文件被更改,包括 9 次插入1 次删除
  1. 6 0
      app/Http/Controllers/Api/HomeController.php
  2. 2 1
      app/Services/HomeService.php
  3. 1 0
      routes/api.php

+ 6 - 0
app/Http/Controllers/Api/HomeController.php

xqd xqd
@@ -9,6 +9,7 @@ use App\Exceptions\AuthException;
 use App\Exceptions\VipException;
 use App\Http\Params\UserCommentParam;
 use App\Http\Params\UserLikeParam;
+use App\Models\SystemConfig;
 use App\Models\UserPhotoDestroy;
 use App\Services\DynamicService;
 use App\Services\HomeService;
@@ -55,6 +56,11 @@ class HomeController extends Controller
         return response()->json(['message'=>"请求成功"]);
     }
 
+    public function get_fx(){
+        $res = SystemConfig::query()->where('id',2)->value("value");
+        return response()->json(['data'=>$res]);
+    }
+
     /**
      * 返回首页信息
      * @param Request $request

+ 2 - 1
app/Services/HomeService.php

xqd
@@ -59,7 +59,8 @@ class HomeService
 
 
         if($param['keyword']!=""){
-            $query = $query->where('users_info.nickname','like','%'.$param['keyword'].'%')->orWhere('users_info.hobby','like','%'.$param['keyword'].'%');
+            $query = $query->where('users_info.nickname','like','%'.$param['keyword'].'%')
+                ->orWhere('users_info.hobby','like','%'.$param['keyword'].'%');
         }
 
         if($param['online']==1){

+ 1 - 0
routes/api.php

xqd
@@ -30,6 +30,7 @@ $api->version('v1', [
         $api->group(['prefix' => 'home'], function ($api) {
             $api->post('/home', 'HomeController@home')->name('home.home');
             $api->post('/get_location', 'HomeController@get_location')->name('home.get_location');
+            $api->post('/get_fx', 'HomeController@get_fx')->name('home.get_fx');
             $api->post('/user_detail', 'HomeController@user_detail')->name('home.user_detail');
             $api->post('/user_dynamic', 'HomeController@user_dynamic')->name('home.user_dynamic');
             $api->post('/photo_destroy', 'HomeController@photo_destroy')->name('home.photo_destroy');