From 241e374f4044c96c4065b1f3325fe092485d8755 Mon Sep 17 00:00:00 2001 From: wuhui_zzw <1760308791@qq.com> Date: Thu, 23 Mar 2023 11:34:00 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E6=B3=A8?= =?UTF-8?q?=E5=86=8C=E6=88=90=E5=8A=9F=E5=90=8E=E8=B5=A0=E9=80=813?= =?UTF-8?q?=E9=A2=97=E7=A0=96=E7=9F=B3=20=E6=B2=A1=E6=9C=89=20=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=EF=BC=9A=E5=88=86=E9=94=80=E5=95=86=E6=B5=81=E6=B0=B4?= =?UTF-8?q?=20=E4=BF=AE=E5=A4=8D=EF=BC=9A=E5=8D=87=E7=BA=A7=E7=94=B3?= =?UTF-8?q?=E8=AF=B7=20=E6=94=B9=E4=B8=BA=20=E4=BB=A3=E7=90=86=E7=94=B3?= =?UTF-8?q?=E8=AF=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addon/fenxiao/api/controller/Apply.php | 4 +- addon/fenxiao/model/Fenxiao.php | 11 +- addon/fenxiao/model/FenxiaoAccount.php | 4 +- addon/fenxiao/model/FenxiaoApply.php | 4 +- addon/fenxiao/shop/controller/Fenxiao.php | 56 ++++- addon/fenxiao/shop/view/config/basics.html | 2 +- addon/fenxiao/shop/view/fenxiao/account.html | 207 +++++++++++++++++++ config/menu_shop.php | 20 +- 8 files changed, 290 insertions(+), 18 deletions(-) create mode 100644 addon/fenxiao/shop/view/fenxiao/account.html diff --git a/addon/fenxiao/api/controller/Apply.php b/addon/fenxiao/api/controller/Apply.php index 4e054b1a..7bff9bee 100644 --- a/addon/fenxiao/api/controller/Apply.php +++ b/addon/fenxiao/api/controller/Apply.php @@ -99,7 +99,7 @@ class Apply extends BaseApi } /** - * Common: 用户升级申请基本信息获取 + * Common: 用户代理申请基本信息获取 * Author: wu-hui * Time: 2023/02/27 10:35 * @return false|string @@ -119,7 +119,7 @@ class Apply extends BaseApi return $this->response($this->success($data)); } /** - * Common: 分销商升级申请信息 + * Common: 代理申请信息 * Author: wu-hui * Time: 2023/02/27 10:31 * @return false|string diff --git a/addon/fenxiao/model/Fenxiao.php b/addon/fenxiao/model/Fenxiao.php index 75b4554b..7d9f29a3 100644 --- a/addon/fenxiao/model/Fenxiao.php +++ b/addon/fenxiao/model/Fenxiao.php @@ -70,6 +70,13 @@ class Fenxiao extends BaseModel $stat_model = new Stat(); $stat_model->switchStat([ 'type' => 'add_fenxiao_member', 'data' => [ 'site_id' => $data[ 'site_id' ] ] ]); + + // 成为分销商后 赠送钻石操作 + $basics = (new Config())->getFenxiaoBasicsConfig($data[ 'site_id' ])['data']['value']; + if((int)$res > 0 && ((float)$basics['newuser_points'] ?? 0) > 0){ + (new FenxiaoAccount())->addAccount((int)$res, $data['fenxiao_name'], 'diamond', (float)$basics['newuser_points'], 0,'diamond', '新用户注册赠送'); + } + model('fenxiao')->commit(); return $this->success($res); } catch (\Exception $e) { @@ -427,10 +434,6 @@ class Fenxiao extends BaseModel 'level_name' => $level_info[ 'data' ][ 'level_name' ] ]; $res = $this->addFenxiao($data); - // 用户注册成功后 奖励信息 - if((int)$res['data'] > 0 && ((float)$config['newuser_points'] ?? 0) > 0){ - (new FenxiaoAccount())->addAccount((int)$res['data'], $data['fenxiao_name'], 'diamond', (float)$config['newuser_points'], 0,'diamond', '新用户注册赠送'); - } return $res; } diff --git a/addon/fenxiao/model/FenxiaoAccount.php b/addon/fenxiao/model/FenxiaoAccount.php index 11d12ba4..464553af 100644 --- a/addon/fenxiao/model/FenxiaoAccount.php +++ b/addon/fenxiao/model/FenxiaoAccount.php @@ -77,9 +77,9 @@ class FenxiaoAccount extends BaseModel * @param string $order * @param string $field */ - public function getFenxiaoAccountPageList($condition = [], $page = 1, $page_size = PAGE_LIST_ROWS, $order = 'create_time desc', $field = '*') + public function getFenxiaoAccountPageList($condition = [], $page = 1, $page_size = PAGE_LIST_ROWS, $order = 'create_time desc', $field = '*',$alias = 'a',$join = []) { - $list = model('fenxiao_account')->pageList($condition, $field, $order, $page, $page_size); + $list = model('fenxiao_account')->pageList($condition, $field, $order, $page, $page_size,$alias,$join); return $this->success($list); } diff --git a/addon/fenxiao/model/FenxiaoApply.php b/addon/fenxiao/model/FenxiaoApply.php index edfb2422..74bf8909 100644 --- a/addon/fenxiao/model/FenxiaoApply.php +++ b/addon/fenxiao/model/FenxiaoApply.php @@ -309,7 +309,7 @@ class FenxiaoApply extends BaseModel /** - * Common: 获取分销商升级申请 + * Common: 获取代理申请 * Author: wu-hui * Time: 2023/02/27 10:18 * @param array $condition @@ -382,7 +382,7 @@ class FenxiaoApply extends BaseModel return $this->success($list); } /** - * Common: 升级申请 审核 + * Common: 代理申请 审核 * Author: wu-hui * Time: 2023/02/27 14:28 * @return array diff --git a/addon/fenxiao/shop/controller/Fenxiao.php b/addon/fenxiao/shop/controller/Fenxiao.php index 32e156cd..271559d8 100644 --- a/addon/fenxiao/shop/controller/Fenxiao.php +++ b/addon/fenxiao/shop/controller/Fenxiao.php @@ -701,7 +701,7 @@ class Fenxiao extends BaseShop } /** - * Common: 分销商升级申请 + * Common: 代理申请 * Author: wu-hui * Time: 2023/02/27 11:44 * @return array|mixed @@ -758,5 +758,59 @@ class Fenxiao extends BaseShop return (new FenxiaoApply())->upgradeApplyExamine(); } + // 分销商流水 + public function accountStatement(){ + if(request()->isAjax()){ + // 参数获取 + $page = input('page',1); + $pageSize = input('page_size',PAGE_LIST_ROWS); + $searchText = input('search_text'); + $fromType = input('from_type'); + $startTime = input('start_time', ''); + $endTime = input('end_time', ''); + $memberId = (int)input('member_id'); + // 获取内容 + $field = [ + 'm.member_id', + 'm.username', + 'm.nickname', + 'm.headimg', + 'a.id', + 'a.money', + 'a.type', + 'a.type_name', + 'a.create_time', + 'a.remarks', + ]; + // 表关联 + $join = [ + ['fenxiao f', 'f.fenxiao_id = a.fenxiao_id', 'left'], + ['member m', 'm.member_id = f.member_id', 'left'], + ]; + // 条件生成 + $condition = [ + ['m.site_id','=',$this->site_id], + ['m.member_id','>',0] + ]; + if($searchText) $condition[] = ['m.username|m.nickname',"like","%{$searchText}%"]; + if($fromType) $condition[] = ['a.type',"=",$fromType]; + if($memberId > 0) $condition[] = ['m.member_id','=',$memberId]; + //发生时间 + if($startTime != '' && $endTime != '') $condition[] = ['a.create_time','between',[strtotime($startTime),strtotime($endTime)]]; + elseif($startTime != '' && $endTime == '') $condition[] = ['a.create_time','>=',strtotime($startTime)]; + elseif($startTime == '' && $endTime != '') $condition[] = ['a.create_time','<=',strtotime($endTime)]; + + return(new FenxiaoAccount())->getFenxiaoAccountPageList($condition,$page,$pageSize,'a.id desc', $field,'a',$join); + } + // 获取流水类型 + $typeList = Db::name('fenxiao_account') + ->field('type,type_name') + ->group('type') + ->select(); + if($typeList) $typeList = $typeList->toArray(); + $this->assign('typeList',$typeList); + + return $this->fetch('fenxiao/account'); + } } \ No newline at end of file diff --git a/addon/fenxiao/shop/view/config/basics.html b/addon/fenxiao/shop/view/config/basics.html index b3627426..acb01e5f 100644 --- a/addon/fenxiao/shop/view/config/basics.html +++ b/addon/fenxiao/shop/view/config/basics.html @@ -95,7 +95,7 @@
下单分享D位置得贡献值,得消费额百分比
-->
- +
diff --git a/addon/fenxiao/shop/view/fenxiao/account.html b/addon/fenxiao/shop/view/fenxiao/account.html new file mode 100644 index 00000000..7c4df7e7 --- /dev/null +++ b/addon/fenxiao/shop/view/fenxiao/account.html @@ -0,0 +1,207 @@ +{extend name="app/shop/view/base.html"/} +{block name="resources"} + +{/block} + +{block name="main"} + +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+ +
+ + +
+
-
+
+ + +
+ + +
+
+
+ + +
+
+
+
+ +
+ + +{/block} + +{block name="script"} + +{/block} \ No newline at end of file diff --git a/config/menu_shop.php b/config/menu_shop.php index b473cbc3..e54d76e0 100644 --- a/config/menu_shop.php +++ b/config/menu_shop.php @@ -1774,14 +1774,13 @@ return [ ], [ 'name' => 'MEMBER_ACCOUNT_BALANCE', - 'title' => '余额储值', + 'title' => '账号流水', 'url' => 'shop/memberaccount/balance', - 'is_show' => 0, + 'is_show' => 1, 'picture' => 'app/shop/view/public/img/icon_new/member_group_new.png', 'picture_selected' => 'app/shop/view/public/img/icon_new/member_group_select.png', 'sort' => 3, 'child_list' => [ - [ 'name' => 'MEMBER_ACCOUNT_BALANCE_LIST', 'title' => '余额流水', @@ -1792,14 +1791,14 @@ return [ 'sort' => 2, 'child_list' => [ ], - ], + ] ], ], [ 'name' => 'MEMBER_ACCOUNT_POINT', 'title' => '会员积分', 'url' => 'shop/memberaccount/point', - 'is_show' => 0, + 'is_show' => 1, 'picture' => 'app/shop/view/public/img/icon_new/member_group_new.png', 'picture_selected' => 'app/shop/view/public/img/icon_new/member_group_select.png', 'sort' => 3, @@ -1983,7 +1982,7 @@ return [ // ], [ 'name' => 'PROMOTION_FENXIAO_UPGRADE_APPLY', - 'title' => '升级申请', + 'title' => '代理申请', 'url' => 'fenxiao://shop/fenxiao/upgradeApply', 'is_show' => 1, 'sort' => 4, @@ -2190,6 +2189,15 @@ return [ ] ] ], + [ + 'name' => 'PROMOTION_FENXIAO_ACCOUNT', + 'title' => '分销流水', + 'url' => 'fenxiao://shop/fenxiao/accountStatement', + 'is_show' => 1, + 'is_control' => 1, + 'sort' => 100, + 'child_list' => [] + ], ] ], From 01176a459019295f4249222b1aaf8908d7a3f9f3 Mon Sep 17 00:00:00 2001 From: wuhui_zzw <1760308791@qq.com> Date: Thu, 23 Mar 2023 11:46:36 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BC=98=E5=8C=96=EF=BC=9A=E5=88=86?= =?UTF-8?q?=E9=94=80=E5=95=86=E6=B5=81=E6=B0=B4=E5=88=86=E4=B8=BA=E9=92=BB?= =?UTF-8?q?=E7=9F=B3=E6=B5=81=E6=B0=B4=E5=92=8C=E5=88=86=E9=94=80=E5=95=86?= =?UTF-8?q?=E6=B5=81=E6=B0=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- addon/fenxiao/shop/controller/Fenxiao.php | 30 +++- app/shop/controller/Memberaccount.php | 6 + app/shop/view/account/diamond.html | 197 ++++++++++++++++++++++ config/menu_shop.php | 13 +- 4 files changed, 236 insertions(+), 10 deletions(-) create mode 100644 app/shop/view/account/diamond.html diff --git a/addon/fenxiao/shop/controller/Fenxiao.php b/addon/fenxiao/shop/controller/Fenxiao.php index 271559d8..3c4dd3d3 100644 --- a/addon/fenxiao/shop/controller/Fenxiao.php +++ b/addon/fenxiao/shop/controller/Fenxiao.php @@ -757,8 +757,12 @@ class Fenxiao extends BaseShop return (new FenxiaoApply())->upgradeApplyExamine(); } - - // 分销商流水 + /** + * Common: 分销商流水 + * Author: wu-hui + * Time: 2023/03/23 11:40 + * @return array|mixed + */ public function accountStatement(){ if(request()->isAjax()){ // 参数获取 @@ -795,19 +799,29 @@ class Fenxiao extends BaseShop if($searchText) $condition[] = ['m.username|m.nickname',"like","%{$searchText}%"]; if($fromType) $condition[] = ['a.type',"=",$fromType]; if($memberId > 0) $condition[] = ['m.member_id','=',$memberId]; - //发生时间 + // 发生时间 if($startTime != '' && $endTime != '') $condition[] = ['a.create_time','between',[strtotime($startTime),strtotime($endTime)]]; elseif($startTime != '' && $endTime == '') $condition[] = ['a.create_time','>=',strtotime($startTime)]; elseif($startTime == '' && $endTime != '') $condition[] = ['a.create_time','<=',strtotime($endTime)]; + // 是否获取钻石:获取钻石-仅获取钻石流水,不获取钻石-获取除钻石外所有流水 + if($fromType == 'diamond') $condition[] = ['a.type',"=",'diamond']; + else $condition[] = ['a.type',"<>",'diamond']; + return(new FenxiaoAccount())->getFenxiaoAccountPageList($condition,$page,$pageSize,'a.id desc', $field,'a',$join); } // 获取流水类型 - $typeList = Db::name('fenxiao_account') - ->field('type,type_name') - ->group('type') - ->select(); - if($typeList) $typeList = $typeList->toArray(); + $typeList = [ + ['type' => 'withdraw','type_name' => '提现'], + ['type' => 'order','type_name' => '订单结算'], + ['type' => 'points','type_name' => '积分'], + ]; + // $typeList = Db::name('fenxiao_account') + // ->field('type,type_name') + // ->where('type',"<>",'diamond') + // ->group('type') + // ->select(); + // if($typeList) $typeList = $typeList->toArray(); $this->assign('typeList',$typeList); return $this->fetch('fenxiao/account'); diff --git a/app/shop/controller/Memberaccount.php b/app/shop/controller/Memberaccount.php index 05c4c430..4070116b 100644 --- a/app/shop/controller/Memberaccount.php +++ b/app/shop/controller/Memberaccount.php @@ -217,4 +217,10 @@ class Memberaccount extends BaseShop return $result; } + // 钻石流水 + public function diamond(){ + + return $this->fetch('account/diamond'); + } + } \ No newline at end of file diff --git a/app/shop/view/account/diamond.html b/app/shop/view/account/diamond.html new file mode 100644 index 00000000..f0e95b1e --- /dev/null +++ b/app/shop/view/account/diamond.html @@ -0,0 +1,197 @@ +{extend name="app/shop/view/base.html"/} +{block name="resources"} + +{/block} + +{block name="main"} + +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+
+ +
+ + +
+
-
+
+ + +
+ + +
+
+
+ + +
+
+
+
+ +
+ + +{/block} + +{block name="script"} + +{/block} \ No newline at end of file diff --git a/config/menu_shop.php b/config/menu_shop.php index e54d76e0..37631383 100644 --- a/config/menu_shop.php +++ b/config/menu_shop.php @@ -1789,8 +1789,17 @@ return [ 'picture' => '', 'picture_selected' => '', 'sort' => 2, - 'child_list' => [ - ], + 'child_list' => [], + ], + [ + 'name' => 'MEMBER_ACCOUNT_DIAMOND_LIST', + 'title' => '钻石流水', + 'url' => 'shop/memberaccount/diamond', + 'is_show' => 1, + 'picture' => '', + 'picture_selected' => '', + 'sort' => 2, + 'child_list' => [], ] ], ],