|
|
@@ -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
|