diff --git a/server/app/admin/controller/user/BusinessTeam.php b/server/app/admin/controller/user/BusinessTeam.php index 5aac9d82..616a9d53 100644 --- a/server/app/admin/controller/user/BusinessTeam.php +++ b/server/app/admin/controller/user/BusinessTeam.php @@ -70,20 +70,4 @@ class BusinessTeam extends AdminBase } return JsonServer::error(BusinessTeamLogic::getError()); } - -// public function set() -// { -// if($this->request->isAjax()) { -// $post = $this->request->post(); -// ConfigServer::set('user_level', 'intro', $post['intro']); -// return JsonServer::success('设置成功'); -// } -// $intro = ConfigServer::get('user_level', 'intro'); -// $intro_default = config('default.user_level.intro'); -// -// return view('', [ -// 'intro' => $intro, -// 'intro_default' => $intro_default -// ]); -// } } \ No newline at end of file diff --git a/server/app/admin/controller/user/User.php b/server/app/admin/controller/user/User.php index 7bce7440..8fa0d1f6 100644 --- a/server/app/admin/controller/user/User.php +++ b/server/app/admin/controller/user/User.php @@ -1,7 +1,9 @@ LevelLogic::getLevelList(), 'tag_list' => TagLogic::getTagList(), - 'client_list' => ClientEnum::getClient(true) + 'client_list' => ClientEnum::getClient(true), + 'team_list' => BusinessTeamLogic::getBusinessTeamList() ]); } + public function add() + { + if($this->request->isAjax()) { + try{ + $input = input('post.'); + + $rule = [ + 'password|密码' => 'require|min:2|max:50', + 'password_confirm|确认密码' => 'require|min:2|max:50', + 'phone|手机' => 'require|mobile', + ]; + + $validate = Validate::rule($rule); + if (!$validate->check($input)) { + return JsonServer::error($validate->getError()); + } + + if ($input['password'] != $input['password_confirm']) { + return JsonServer::error('两次密码不一致'); + } + + if (\app\common\model\user\User::where('mobile', $input['phone'])->where('del', 0)->count()>0) { + return JsonServer::error('此手机号已被使用'); + } + $post = [ + 'mobile' => $input['phone'], + 'password' => $input['password'], + 'client' => ClientEnum::backend, + ]; + LoginLogic::register($post); + if (!empty(LoginLogic::getError())) { + return JsonServer::error(LoginLogic::getError()); + } + return JsonServer::success('添加成功'); + }catch(ValidateException $e) { + return JsonServer::error($e->getError()); + }catch(\Exception $e) { + return JsonServer::error($e->getMessage()); + } + + return JsonServer::error('添加失败'); + } + return view(); + } + public function setTag(){ if($this->request->isAjax()){ $post = $this->request->post(); @@ -65,7 +114,8 @@ class User extends AdminBase return view('', [ 'info' => $detail, - 'tag_list' => json_encode(TagLogic::getTagList()) + 'tag_list' => json_encode(TagLogic::getTagList()), + 'team_list' => json_encode(BusinessTeamLogic::getBusinessTeamList([$id])) ]); } diff --git a/server/app/admin/logic/user/BusinessTeamLogic.php b/server/app/admin/logic/user/BusinessTeamLogic.php index d7b47790..5e0c21bd 100644 --- a/server/app/admin/logic/user/BusinessTeamLogic.php +++ b/server/app/admin/logic/user/BusinessTeamLogic.php @@ -70,12 +70,17 @@ class BusinessTeamLogic extends Logic } } - public static function getBusinessTeamList() + public static function getBusinessTeamList($selected = []) { $levelArr = BusinessTeam::field('id,name,phone') + ->order('id desc') ->select() ->toArray(); - $levelArr[0] = ['id'=>0, 'name'=>'暂无团队', 'phone' => '']; + foreach ($levelArr as &$item) { + if (in_array($item['id'], $selected)) { + $item['selected'] = true; + } + } return $levelArr; } diff --git a/server/app/admin/logic/user/UserLogic.php b/server/app/admin/logic/user/UserLogic.php index fde7c850..4c8d8c49 100644 --- a/server/app/admin/logic/user/UserLogic.php +++ b/server/app/admin/logic/user/UserLogic.php @@ -148,7 +148,7 @@ class UserLogic extends Logic { $field = [ 'id', 'sn','nickname','avatar','mobile','sex','birthday','tag_ids', - 'remark','user_money','user_growth','user_integral','earnings', 'disable' + 'remark','user_money','user_growth','user_integral','earnings', 'disable', 'team_id' ]; $user = User::field($field)->where(['del' => 0, 'id' => $id])->findOrEmpty(); @@ -161,6 +161,8 @@ class UserLogic extends Logic } // 会员标签 $user['tag_ids'] = json_encode(explode(',', $user['tag_ids'])); + // 业务团队 + $user['team_ids'] = json_encode(explode(',', $user['team_id'])); return $user->toArray(); } @@ -175,6 +177,7 @@ class UserLogic extends Logic 'mobile' => $post['mobile'], 'birthday' => strtotime($post['birthday']), 'tag_ids' => $post['select'], + 'team_id' => $post['team_id'] ?? 0, 'remark' => $post['remark'], 'disable' => $post['disable'], 'update_time' => time() diff --git a/server/app/admin/view/user/business_team/add.html b/server/app/admin/view/user/business_team/add.html new file mode 100644 index 00000000..ef413cbe --- /dev/null +++ b/server/app/admin/view/user/business_team/add.html @@ -0,0 +1,31 @@ +{layout name="layout2" /} + +
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+
diff --git a/server/app/admin/view/user/business_team/adjust_account.html b/server/app/admin/view/user/business_team/adjust_account.html deleted file mode 100644 index ce28cd05..00000000 --- a/server/app/admin/view/user/business_team/adjust_account.html +++ /dev/null @@ -1,171 +0,0 @@ -{layout name="layout2" /} - -
- - -
-
-
-
    -
  • 不可提现金额调整
  • -
  • 成长值调整
  • -
  • 积分调整
  • -
  • 佣金调整
  • -
-
- -
-
- -
- -
-
-
- -
- - -
-
-
- -
- - -
- -
-
- -
- - -
-
- -
- -
-
- -
- -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
-
-
- -
-
- -
- - -
-
-
- -
- - -
-
-
- -
- - -
- -
-
- -
- - -
-
-
- -
-
- -
- -
-
-
- -
- - -
-
-
- -
- - -
- -
-
- -
- - -
-
-
-
-
-
-
- -
- -
-
- diff --git a/server/app/admin/view/user/business_team/adjust_first_leader.html b/server/app/admin/view/user/business_team/adjust_first_leader.html deleted file mode 100644 index 2064a5ed..00000000 --- a/server/app/admin/view/user/business_team/adjust_first_leader.html +++ /dev/null @@ -1,87 +0,0 @@ -{layout name="layout2" /} - -
-
- -
- -
-
-
- -
- -
-
-
- -
- {if is_array($first_leader)} - - {else} - - {/if} -
-
-
- -
- -
-
- -
-
-
- -
- -
-
- -
-
- - - -
- -
-
- diff --git a/server/app/admin/view/user/business_team/adjust_level.html b/server/app/admin/view/user/business_team/adjust_level.html deleted file mode 100644 index a397c980..00000000 --- a/server/app/admin/view/user/business_team/adjust_level.html +++ /dev/null @@ -1,52 +0,0 @@ -{layout name="layout2" /} - -
-
- -
- -
-
-
- -
- -
-
-
- -
- - -
-
- - -
- -
-
- diff --git a/server/app/admin/view/user/business_team/edit.html b/server/app/admin/view/user/business_team/edit.html index 54c65f50..a97fed7c 100644 --- a/server/app/admin/view/user/business_team/edit.html +++ b/server/app/admin/view/user/business_team/edit.html @@ -1,130 +1,36 @@ {layout name="layout2" /} -
- +
+
- -
- {$info.sn} + +
+
-
- -
- -
-
-
- -
- -
-
-
- - 建议尺寸:宽200像素*高200像素的jpg,jpeg,png图片 -
-
- -
- -
-
- -
- -
- - - -
-
-
- -
- - -
-
禁用后用户将无法正常登录
-
-
- -
- -
-
-
- -
-
-
-
-
- -
- +
+ +
+
- +
-
- - \ No newline at end of file + \ No newline at end of file diff --git a/server/app/admin/view/user/business_team/fans.html b/server/app/admin/view/user/business_team/fans.html deleted file mode 100644 index 2cab2746..00000000 --- a/server/app/admin/view/user/business_team/fans.html +++ /dev/null @@ -1,158 +0,0 @@ -{layout name="layout1" /} - -
-
-
-
-
    -
  • 下一级
  • -
  • 下二级
  • -
-
- - -
-
- - - \ No newline at end of file diff --git a/server/app/admin/view/user/business_team/info.html b/server/app/admin/view/user/business_team/info.html deleted file mode 100644 index 2d363df6..00000000 --- a/server/app/admin/view/user/business_team/info.html +++ /dev/null @@ -1,181 +0,0 @@ -{layout name="layout2" /} - -
-
-
- 基础信息 -
-
-
- -
- -
- -
- -
-
-
- -
- -
- -
- -
-
-
- -
- -
- -
- -
-
-
- -
- -
- -
- -
-
-
- -
-
- -
- -
- -
- -
-
-
- -
- -
- -
- -
-
-
-
- 钱包信息 -
-
-
- -
- -
- -
- -
-
-
- -
- -
-
-
-
- 消费能力 -
-
-
- -
- -
- -
- -
-
-
- -
- -
-
-
-
- 推荐信息 -
-
-
- -
- {if $detail.first_leader_info != '系统'} - - {else} - - {/if} -
-
-
- -
- -
-
- -
-
-
- - \ No newline at end of file diff --git a/server/app/admin/view/user/business_team/lists.html b/server/app/admin/view/user/business_team/lists.html index 232daa58..cd12a790 100644 --- a/server/app/admin/view/user/business_team/lists.html +++ b/server/app/admin/view/user/business_team/lists.html @@ -1,134 +1,103 @@ {layout name="layout1" /}
- - +
+
- - - - - - +
+
+ +
-
- +
+ -
+
+
-
+
+ \ No newline at end of file diff --git a/server/app/admin/view/user/business_team/set_tag.html b/server/app/admin/view/user/business_team/set_tag.html deleted file mode 100644 index e763e918..00000000 --- a/server/app/admin/view/user/business_team/set_tag.html +++ /dev/null @@ -1,34 +0,0 @@ -{layout name="layout2" /} -
- -
- -
-
-
-
-
- -
-
- \ No newline at end of file diff --git a/server/app/admin/view/user/business_team/user_lists.html b/server/app/admin/view/user/business_team/user_lists.html deleted file mode 100644 index 7670c17d..00000000 --- a/server/app/admin/view/user/business_team/user_lists.html +++ /dev/null @@ -1,121 +0,0 @@ -{layout name="layout1" /} - -
-
-
- - - -
- - - -
-
-
- - - \ No newline at end of file diff --git a/server/app/admin/view/user/user/add.html b/server/app/admin/view/user/user/add.html new file mode 100644 index 00000000..d0eb659e --- /dev/null +++ b/server/app/admin/view/user/user/add.html @@ -0,0 +1,39 @@ +{layout name="layout2" /} + +
+
+ +
+ +
+
+
+ +
+ +
+
+ +
+ +
+ +
+
+ +
+ +
+
\ No newline at end of file diff --git a/server/app/admin/view/user/user/edit.html b/server/app/admin/view/user/user/edit.html index 54c65f50..22854ff2 100644 --- a/server/app/admin/view/user/user/edit.html +++ b/server/app/admin/view/user/user/edit.html @@ -75,6 +75,12 @@
+
+ +
+
+
+
@@ -97,7 +103,9 @@ var $ = layui.$,form = layui.form,laydate = layui.laydate; var xmSelect = layui.xmSelect; var tag_list = '{$tag_list|raw}'; + var team_list = '{$team_list|raw}'; var initValue = '{$info.tag_ids | raw}'; + var teamValue = '{$info.team_ids | raw}'; laydate.render({ elem: '#birthday' @@ -116,6 +124,23 @@ initValue: JSON.parse(initValue) }) + var xmIns = xmSelect.render({ + el: '#teamList', + language: 'zn', + data: JSON.parse(team_list), + name: 'team_id', + radio: true, + prop: { + value: 'id' + }, + initValue: JSON.parse(teamValue) + }) + + // $('#teamList').on('change', function(e) { + // var selectedValue = e.target.value; + // $('#team-value').val(selectedValue); + // }); + // 图片上传 like.delUpload(); $(document).on("click", "#avatar", function () { diff --git a/server/app/admin/view/user/user/lists.html b/server/app/admin/view/user/user/lists.html index 319870dd..216c770a 100644 --- a/server/app/admin/view/user/user/lists.html +++ b/server/app/admin/view/user/user/lists.html @@ -68,6 +68,17 @@
+
+ +
+ +
+
@@ -105,6 +116,7 @@
+
@@ -122,6 +134,7 @@ 正常 {{# } }}

+

业务团队:{{d.team_name}}

@@ -219,6 +232,7 @@ $('#tag').val(''); //清空输入框 $('#client').val(''); //清空输入框 $('#disable').val(''); //清空禁用状态 + $('#team_id').val(''); //业务团队 $('#total_amount_start').val(''); //清空输入框 $('#total_amount_end').val(''); //清空输入框 $('#start_time').val(''); //清空输入框 @@ -343,7 +357,46 @@ } }); - } + }, + add: function(){ + var index = layer.open({ + type: 2 + ,title: '新增会员' + ,content: '{:url("user.user/add")}' + ,area: ['90%', '90%'] + ,btn: ['保存', '取消'] + ,maxmin: true + ,yes: function(index, layero){ + var iframeWindow = window['layui-layer-iframe'+ index] + ,submitID = 'add-user_level-submit' + ,submit = layero.find('iframe').contents().find('#'+ submitID); + //监听提交 + iframeWindow.layui.form.on('submit('+ submitID +')', function(data){ + var field = data.field; + like.ajax({ + url:'{:url("user.user/add")}', + data:field, + type:"post", + success:function(res) + { + if(res.code == 1) + { + layui.layer.msg(res.msg, { + offset: '15px' + , icon: 1 + , time: 1000 + }); + layer.close(index); //关闭弹层 + table.reload('user-lists'); //数据刷新 + } + } + }); + }); + + submit.trigger('click'); + } + }); + }, } $('.layui-btn.layuiadmin-btn-user').on('click', function(){ var type = $(this).data('type'); diff --git a/server/app/api/logic/OrderLogic.php b/server/app/api/logic/OrderLogic.php index 7a26da6b..8b92e2a3 100644 --- a/server/app/api/logic/OrderLogic.php +++ b/server/app/api/logic/OrderLogic.php @@ -923,6 +923,8 @@ class OrderLogic extends Logic $order_data['coupon_list_id'] = $coupon_list_id; $order_data['create_time'] = time(); + $order_data['team_id'] = $user['team_id'];//订单所属团队 + // 前置订单 $order_data['is_frontend'] = 0; if (!empty($post['is_frontend'])) { @@ -1673,9 +1675,9 @@ class OrderLogic extends Logic ->field('o.id,order_status,total_num,og.image,o.consignee,o.mobile,o.province,o.city,o.district,o.address,pay_time,confirm_take_time,o.shipping_status,shipping_time') ->append(['delivery_address']) ->find(); - if (!self::checkDelivery($order['delivery_id'])) { - return false; - } +// if (!self::checkDelivery($order['delivery_id'])) { +// return false; +// } //初始化数据 $order_tips = '已下单'; $order_traces = []; diff --git a/server/app/common/enum/ClientEnum.php b/server/app/common/enum/ClientEnum.php index 549ecc11..3f7bedd3 100644 --- a/server/app/common/enum/ClientEnum.php +++ b/server/app/common/enum/ClientEnum.php @@ -29,6 +29,7 @@ class ClientEnum const android = 4; const pc = 5; const h5 = 6;//h5(非微信环境h5) + const backend = 7;//PC后台 function getName($value) { @@ -50,6 +51,8 @@ class ClientEnum break; case self::oa: $name = '公众号'; + case self::backend: + $name = '后台'; break; } return $name; @@ -65,6 +68,7 @@ class ClientEnum self::mnp => '小程序商城', self::ios => '苹果APP商城', self::android => '安卓APP商城', + self::backend => '后台', ]; if ($type === true) { return $desc;