wesmiler vor 2 Monaten
Ursprung
Commit
d2dac8cf52
3 geänderte Dateien mit 0 neuen und 76 gelöschten Zeilen
  1. 0 20
      app/Http/Controllers/Api/v1/JobsController.php
  2. 0 55
      app/Services/Api/JobsService.php
  3. 0 1
      routes/api.php

+ 0 - 20
app/Http/Controllers/Api/v1/JobsController.php

@@ -55,24 +55,4 @@ class JobsController extends webApp
         }
     }
 
-    /**
-     * 申请
-     * @return array
-     */
-    public function apply()
-    {
-        $params = request()->all();
-
-       try {
-           if(!$result = JobsService::make()->apply($this->userId, $params)){
-               return showJson(JobsService::make()->getError(), false);
-           }else{
-               return showJson(JobsService::make()->getError(), true, $result);
-           }
-       } catch (\Exception $exception) {
-           $error = ['data' => $exception->getTrace(), 'err' => $exception->getMessage()];
-           return showJson(1046, false, $error);
-       }
-    }
-
 }

+ 0 - 55
app/Services/Api/JobsService.php

@@ -118,61 +118,6 @@ class JobsService extends BaseService
         return $datas;
     }
 
-
-    /**
-     * 申请
-     * @param $userId
-     * @param $params
-     * @return mixed
-     */
-    public function apply($userId, $params)
-    {
-        $name = isset($params['name']) ? trim($params['name']) : '';
-        $realname = isset($params['real_name']) ? trim($params['real_name']) : '';
-        $phone = isset($params['phone']) ? trim($params['phone']) : '';
-        $address = isset($params['address']) ? trim($params['address']) : '';
-        $categoryId = isset($params['category_id']) ? intval($params['category_id']) : 0;
-        $logo = isset($params['logo']) && $params['logo']? get_image_path($params['logo']) : '';
-        $businessLicense = isset($params['business_license']) && $params['business_license']? get_image_path($params['business_license']) : '';
-        $otherPhoto = isset($params['other_photo']) && $params['other_photo']? get_image_path($params['other_photo']) : '';
-
-        $data = [
-            'user_id' => $userId,
-            'name' => $name,
-            'real_name' => $realname,
-            'phone' => $phone,
-            'address' => $address,
-            'category_id' => $categoryId,
-            'logo' => $logo,
-            'business_license' => $businessLicense,
-            'other_photo' => $otherPhoto,
-            'order_count' => 0,
-            'order_total' => 0,
-            'confirm_remark' => '',
-            'create_time' => time(),
-            'update_time' => time(),
-            'status' => 2,
-            'mark' => 1,
-        ];
-
-        DB::beginTransaction();
-        if($id = $this->model->where(['user_id'=>$userId])->value('id')){
-            $this->model->where(['id'=>$id])->update($data);
-        }else{
-            if (!$id = $this->model->insertGetId($data)) {
-                DB::rollBack();
-                $this->error = '申请入驻失败';
-                return false;
-            }
-        }
-
-        DB::commit();
-        RedisService::keyDel("caches:members:info_*");
-        RedisService::keyDel("caches:stores:info*");
-        $this->error = '申请入驻成功,请耐心等候审核~';
-        return ['id' => $id];
-    }
-
     /**
      * 详情
      * @param $id

+ 0 - 1
routes/api.php

@@ -125,7 +125,6 @@ Route::prefix('v1')->middleware('web.login')->group(function() {
     // 招聘
     Route::post('/jobs/index', [\App\Http\Controllers\Api\v1\JobsController::class, 'index']);
     Route::post('/jobs/info', [\App\Http\Controllers\Api\v1\JobsController::class, 'info']);
-    Route::post('/jobs/apply', [\App\Http\Controllers\Api\v1\JobsController::class, 'apply']);
     Route::post('/jobs/category/list', [\App\Http\Controllers\Api\v1\JobsController::class, 'categorys']);