diff --git a/app/api/controller/CommonController.php b/app/api/controller/CommonController.php new file mode 100644 index 000000000..95528506b --- /dev/null +++ b/app/api/controller/CommonController.php @@ -0,0 +1,46 @@ +where(['switch' => 1])->select(); + return $this->data($data->toArray()); + } //**市列表 */ + public function city($city) + { + $data = Db::name('geo_city')->where(['province_code' => $city])->select(); + return $this->data($data->toArray()); + } + //**区域列表 */ + public function area($area) + { + $data = Db::name('geo_area')->where(['city_code' => $area])->select(); + return $this->data($data->toArray()); + } + //**街道列表 */ + public function street($street) + { + $data = Db::name('geo_street')->where(['area_code' => $street])->select(); + return $this->data($data->toArray()); + } + + //**村列表 */ + public function village($village) + { + $data = Db::name('geo_village')->where(['street_code' => $village])->select(); + return $this->data($data->toArray()); + } + //**小队列表 */ + public function brigade() + { + $data = Db::name('geo_brigade')->select(); + return $this->data($data->toArray()); + } +} diff --git a/app/api/controller/LoginController.php b/app/api/controller/LoginController.php index a71445b18..2b23a77f2 100755 --- a/app/api/controller/LoginController.php +++ b/app/api/controller/LoginController.php @@ -16,6 +16,7 @@ namespace app\api\controller; use app\api\validate\{LoginAccountValidate, RegisterValidate, WebScanLoginValidate, WechatLoginValidate}; use app\api\logic\LoginLogic; +use app\Request; /** * 登录注册 @@ -36,6 +37,7 @@ class LoginController extends BaseApiController */ public function register() { + return $this->fail('暂未开放注册,请联系管理员添加账号'); $params = (new RegisterValidate())->post()->goCheck('register'); $result = LoginLogic::register($params); if (true === $result) { @@ -44,6 +46,15 @@ class LoginController extends BaseApiController return $this->fail(LoginLogic::getError()); } + public function add(){ + $params=Request()->param(); + $params['company_id']=69;//$this->userInfo['company_id']; + $result = LoginLogic::register($params); + if (true === $result) { + return $this->success('添加成功', [], 1, 1); + } + return $this->fail(LoginLogic::getError()); + } /** * @notes 账号密码/手机号密码/手机号验证码登录 diff --git a/app/api/logic/LoginLogic.php b/app/api/logic/LoginLogic.php index 1a9263bf0..6a1e1f375 100755 --- a/app/api/logic/LoginLogic.php +++ b/app/api/logic/LoginLogic.php @@ -51,14 +51,27 @@ class LoginLogic extends BaseLogic $passwordSalt = Config::get('project.unique_identification'); $password = create_password($params['password'], $passwordSalt); $avatar = ConfigService::get('default_image', 'user_avatar'); - + // if($params['qualification']){ + // $params['qualification']=explode(',',$params['qualification']); + // } User::create([ 'sn' => $userSn, 'avatar' => $avatar, - 'nickname' => '用户' . $userSn, + 'nickname' =>$userSn, 'account' => $params['account'], + 'mobile' => $params['account'], 'password' => $password, - 'channel' => $params['channel'], + 'channel' => 0, + 'sex'=>$params['sex'], + 'province'=>$params['province'], + 'city'=>$params['city'], + 'area'=>$params['area'], + 'street'=>$params['street'], + 'village'=>$params['village'], + 'brigade'=>$params['brigade'], + 'address'=>$params['address'], + 'qualification'=>json_encode($params['qualification']), + 'company_id'=>$params['company_id'], ]); return true; diff --git a/app/common/cache/UserTokenCache.php b/app/common/cache/UserTokenCache.php index 3e820b150..cc43555ce 100755 --- a/app/common/cache/UserTokenCache.php +++ b/app/common/cache/UserTokenCache.php @@ -82,6 +82,7 @@ class UserTokenCache extends BaseCache 'terminal' => $userSession->terminal, 'expire_time' => $userSession->expire_time, 'admin_id' => $user->admin_id, + 'company_id'=>$user->company_id, ]; $ttl = new \DateTime(Date('Y-m-d H:i:s', $userSession->expire_time)); diff --git a/vendor/ebaoquan/junziqian_sdk b/vendor/ebaoquan/junziqian_sdk index 1294ea49f..9acc82cd2 160000 --- a/vendor/ebaoquan/junziqian_sdk +++ b/vendor/ebaoquan/junziqian_sdk @@ -1 +1 @@ -Subproject commit 1294ea49ff9ecc4532821f8798304816cbf8dd74 +Subproject commit 9acc82cd23d807280ddd29df2117e7890094d049