wanghousheng 8 months ago
commit d964dbcea8
  1. 8
      app/admin/controller/Category.php
  2. 8
      app/admin/model/Store.php
  3. 7
      app/api/controller/Controller.php
  4. 3
      app/api/controller/User.php
  5. 4
      app/common/enum/user/UserTypeEnum.php
  6. 2
      app/common/model/User.php
  7. 2
      app/store/model/User.php

@ -100,9 +100,11 @@ class Category extends Controller
$value['create_time'] = time();
$value['update_time'] = time();
$value['image_id'] = $value['image_id'] ? $this->copyImage($value['image_id'], $new_store_id) : 0;
$value['rank_image_id'] = $value['rank_image_id'] ? $this->copyImage($value['rank_image_id'], $new_store_id) : 0;
$temp = $value;
unset($temp['children']);
unset($temp['image']);
unset($temp['rankimage']);
unset($temp['category_id']);
$firstid = Db::table('yoshop_category')->insertGetId($temp);
@ -116,9 +118,11 @@ class Category extends Controller
$value1['create_time'] = time();
$value1['update_time'] = time();
$value1['image_id'] = $value1['image_id'] ? $this->copyImage($value1['image_id'], $new_store_id) : 0;
$value1['rank_image_id'] = $value1['rank_image_id'] ? $this->copyImage($value1['rank_image_id'], $new_store_id) : 0;
$temp1 = $value1;
unset($temp1['children']);
unset($temp1['image']);
unset($temp1['rankimage']);
unset($temp1['category_id']);
$secondid = Db::table('yoshop_category')->insertGetId($temp1);
@ -132,9 +136,11 @@ class Category extends Controller
$value2['create_time'] = time();
$value2['update_time'] = time();
$value2['image_id'] = $value2['image_id'] ? $this->copyImage($value2['image_id'], $new_store_id) : 0;
$value2['rank_image_id'] = $value2['rank_image_id'] ? $this->copyImage($value2['rank_image_id'], $new_store_id) : 0;
$temp2 = $value2;
unset($temp2['children']);
unset($temp2['image']);
unset($temp2['rankimage']);
unset($temp2['category_id']);
Db::table('yoshop_category')->insertGetId($temp2);
@ -148,9 +154,11 @@ class Category extends Controller
$value3['create_time'] = time();
$value3['update_time'] = time();
$value3['image_id'] = $value3['image_id'] ? $this->copyImage($value3['image_id'], $new_store_id) : 0;
$value3['rank_image_id'] = $value3['rank_image_id'] ? $this->copyImage($value3['rank_image_id'], $new_store_id) : 0;
$temp3 = $value3;
unset($temp3['children']);
unset($temp3['image']);
unset($temp3['rankimage']);
unset($temp3['category_id']);
Db::table('yoshop_category')->insertGetId($temp3);

@ -87,8 +87,10 @@ class Store extends StoreModel
$value['create_time'] = time();
$value['update_time'] = time();
$value['image_id'] = $value['image_id'] ? $this->copyImage($value['image_id'], $new_store_id) : 0;
$value['rank_image_id'] = $value['rank_image_id'] ? $this->copyImage($value['rank_image_id'], $new_store_id) : 0;
$temp = $value;
unset($temp['children']);
unset($temp['rankimage']);
unset($temp['image']);
unset($temp['category_id']);
@ -105,9 +107,11 @@ class Store extends StoreModel
$value1['create_time'] = time();
$value1['update_time'] = time();
$value1['image_id'] = $value1['image_id'] ? $this->copyImage($value1['image_id'], $new_store_id) : 0;
$value1['rank_image_id'] = $value1['rank_image_id'] ? $this->copyImage($value1['rank_image_id'], $new_store_id) : 0;
$temp1 = $value1;
unset($temp1['children']);
unset($temp1['image']);
unset($temp1['rankimage']);
unset($temp1['category_id']);
$secondid = Db::table('yoshop_category')->insertGetId($temp1);
@ -121,9 +125,11 @@ class Store extends StoreModel
$value2['create_time'] = time();
$value2['update_time'] = time();
$value2['image_id'] = $value2['image_id'] ? $this->copyImage($value2['image_id'], $new_store_id) : 0;
$value2['rank_image_id'] = $value2['rank_image_id'] ? $this->copyImage($value2['rank_image_id'], $new_store_id) : 0;
$temp2 = $value2;
unset($temp2['children']);
unset($temp2['image']);
unset($temp2['rankimage']);
unset($temp2['category_id']);
Db::table('yoshop_category')->insertGetId($temp2);
@ -137,9 +143,11 @@ class Store extends StoreModel
$value3['create_time'] = time();
$value3['update_time'] = time();
$value3['image_id'] = $value3['image_id'] ? $this->copyImage($value3['image_id'], $new_store_id) : 0;
$value3['rank_image_id'] = $value3['rank_image_id'] ? $this->copyImage($value3['rank_image_id'], $new_store_id) : 0;
$temp3 = $value3;
unset($temp3['children']);
unset($temp3['image']);
unset($temp3['rankimage']);
unset($temp3['category_id']);
Db::table('yoshop_category')->insertGetId($temp3);

@ -47,6 +47,13 @@ class Controller extends BaseController
$this->checkStore();
// 验证当前客户端状态
$this->checkClient();
$user = $this->getLoginUser();
if ($user) {
if ($user->user_type == 0) {
throwError('很抱歉,您没有权限进入系统');
}
}
}
/**

@ -361,6 +361,9 @@ class User extends Controller
$params = $this->request->param();
$user_id = $params['user_id'] ?? 0;
unset($params['user_id']);
if (isset($params['status']) && $params['status']) {
$params['user_type'] = 0;
}
UserModel::where('user_id', $user_id)->update($params);
return $this->renderSuccess('ok');
}

@ -26,11 +26,11 @@ class UserTypeEnum extends EnumBasics
{
return [
self::NORMAL => [
'name' => '普通会员',
'name' => '游客',
'value' => self::NORMAL,
],
self::MEMBER => [
'name' => 'PLUS会员',
'name' => '会员',
'value' => self::MEMBER,
],
self::DEALER => [

@ -58,7 +58,7 @@ class User extends BaseModel
return $result[$data['user_type']]['name'];
}
}
return '未知';
return '无身份';
}
/**

@ -111,7 +111,7 @@ class User extends UserModel
$filter = [];
// 会员昵称
!empty($params['search']) && $filter[] = ['nick_name|mobile', 'like', "%{$params['search']}%"];
!empty($params['user_type']) && $filter[] = ['user_type', 'in', explode(",", $params['user_type'])];
isset($params['user_type']) && ($params['user_type'] != "") && $filter[] = ['user_type', 'in', explode(",", $params['user_type'])];
// 用户性别
$params['gender'] > -1 && $filter[] = ['gender', '=', (int)$params['gender']];
// 用户等级

Loading…
Cancel
Save