wang hou sheng 7 months ago
parent 17c469fa19
commit 0e3eddc37e
  1. 14
      app/api/service/User.php

@ -129,17 +129,15 @@ class User extends UserService
public static function isStore(): bool public static function isStore(): bool
{ {
$userInfo = static::getCurrentLoginUser(true); $userInfo = static::getCurrentLoginUser(true);
if ($userInfo && $userInfo['user_type'] == UserTypeEnum::STORE) { if ($userInfo && $userInfo['user_type'] == UserTypeEnum::STORE) {
$userId = $userInfo['user_id']; $userId = $userInfo['user_id'];
//商家表里有没有 //商家表里有没有
$model = new \app\common\model\store\User(); // $model = new \app\common\model\store\User();
$store_id = $model->where(['user_id' => $userId])->value('store_id'); // $store_id = $model->where(['user_id' => $userId])->value('store_id');
if ($store_id) { // if ($store_id) {
return true; // return true;
} // }
return true;
} }
return false; return false;
} }

Loading…
Cancel
Save