Compare commits
2 Commits
3eb8bcb6ce
...
4473299e3d
| Author | SHA1 | Date |
|---|---|---|
|
|
4473299e3d | |
|
|
d5861347f1 |
|
|
@ -14,3 +14,4 @@
|
|||
/cashregister
|
||||
/upload
|
||||
/runtime
|
||||
/addon/fenxiao1
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
|
@ -27,15 +26,15 @@ class Apply extends BaseApi
|
|||
public function existFenxiaoName()
|
||||
{
|
||||
$token = $this->checkToken();
|
||||
if ($token['code'] < 0) return $this->response($token);
|
||||
if ($token[ 'code' ] < 0) return $this->response($token);
|
||||
|
||||
$fenxiao_name = isset($this->params['fenxiao_name']) ? $this->params['fenxiao_name'] : '';//分销商名称
|
||||
$fenxiao_name = isset($this->params[ 'fenxiao_name' ]) ? $this->params[ 'fenxiao_name' ] : '';//分销商名称
|
||||
if (empty($fenxiao_name)) {
|
||||
return $this->response($this->error('', 'REQUEST_FENXIAO_NAME'));
|
||||
}
|
||||
|
||||
$apply_model = new FenxiaoApply();
|
||||
$res = $apply_model->existFenxiaoName($fenxiao_name, $this->site_id);
|
||||
$res = $apply_model->existFenxiaoName($fenxiao_name, $this->site_id);
|
||||
|
||||
return $this->response($res);
|
||||
}
|
||||
|
|
@ -46,17 +45,17 @@ class Apply extends BaseApi
|
|||
public function applyFenxiao()
|
||||
{
|
||||
$token = $this->checkToken();
|
||||
if ($token['code'] < 0) return $this->response($token);
|
||||
if ($token[ 'code' ] < 0) return $this->response($token);
|
||||
|
||||
$fenxiao_name = isset($this->params['fenxiao_name']) ? $this->params['fenxiao_name'] : '';//分销商名称
|
||||
$mobile = isset($this->params['mobile']) ? $this->params['mobile'] : '';//联系电话
|
||||
$fenxiao_condition = isset($this->params['fenxiao_condition']) ? $this->params['fenxiao_condition'] : 0;//申请是否无条件
|
||||
|
||||
$config = new Config();
|
||||
$basics_config = $config->getFenxiaoBasicsConfig($this->site_id)['data']['value'];
|
||||
if (!$basics_config['level']) return $this->response($this->error('', '未开启分销功能'));
|
||||
|
||||
if($basics_config['is_apply'] == 1){
|
||||
$fenxiao_name = isset($this->params[ 'fenxiao_name' ]) ? $this->params[ 'fenxiao_name' ] : $this->params['username'];//分销商名称
|
||||
$mobile = isset($this->params[ 'mobile' ]) ? $this->params[ 'mobile' ] : '';//联系电话
|
||||
$id_card = isset($this->params[ 'id_card' ]) ? $this->params[ 'id_card' ] : '';
|
||||
$id_card_front = isset($this->params[ 'id_card_front' ]) ? $this->params[ 'id_card_front'] : '';
|
||||
$id_card_reverse = isset($this->params[ 'id_card_reverse' ]) ? $this->params[ 'id_card_reverse' ] : '';
|
||||
$config = new Config();
|
||||
$basics_config = $config->getFenxiaoBasicsConfig($this->site_id)[ 'data' ][ 'value' ];
|
||||
if (!$basics_config[ 'level' ]) return $this->response($this->error('', '未开启分销功能'));
|
||||
if ($basics_config[ 'is_apply' ] == 1) {
|
||||
if (empty($fenxiao_name)) {
|
||||
return $this->response($this->error('', 'REQUEST_FENXIAO_NAME'));
|
||||
}
|
||||
|
|
@ -64,10 +63,10 @@ class Apply extends BaseApi
|
|||
return $this->response($this->error('', 'REQUEST_MOBILE'));
|
||||
}
|
||||
$apply_model = new FenxiaoApply();
|
||||
$res = $apply_model->applyFenxiao($this->member_id, $this->site_id, $fenxiao_name, $mobile);
|
||||
} else if ($basics_config['is_apply'] == 0) {
|
||||
$res = $apply_model->applyFenxiao($this->member_id, $this->site_id, $fenxiao_name, $mobile,$id_card,$id_card_front,$id_card_reverse);
|
||||
} else if ($basics_config[ 'is_apply' ] == 0) {
|
||||
$apply_model = new Fenxiao();
|
||||
$res = $apply_model->autoBecomeFenxiao($this->member_id, $this->site_id);
|
||||
$res = $apply_model->autoBecomeFenxiao($this->member_id, $this->site_id);
|
||||
} else {
|
||||
return $this->response($this->error('', '未开启分销商申请'));
|
||||
}
|
||||
|
|
@ -78,10 +77,10 @@ class Apply extends BaseApi
|
|||
public function info()
|
||||
{
|
||||
$token = $this->checkToken();
|
||||
if ($token['code'] < 0) return $this->response($token);
|
||||
if ($token[ 'code' ] < 0) return $this->response($token);
|
||||
|
||||
$apply_model = new Fenxiao();
|
||||
$apply_model->getFenxiaoInfo([['member_id', '=', $this->member_id]], 'apply_id,fenxiao_name,parent,member_id,mobile,nickname,headimg,level_id,level_name,status');
|
||||
$apply_model->getFenxiaoInfo([ [ 'member_id', '=', $this->member_id ] ], 'apply_id,fenxiao_name,parent,member_id,mobile,nickname,headimg,level_id,level_name,status');
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -91,47 +90,11 @@ class Apply extends BaseApi
|
|||
public function status()
|
||||
{
|
||||
$token = $this->checkToken();
|
||||
if ($token['code'] < 0) return $this->response($token);
|
||||
if ($token[ 'code' ] < 0) return $this->response($token);
|
||||
|
||||
$apply_model = new FenxiaoApply();
|
||||
$res = $apply_model->getFenxiaoApplyInfo([['member_id', '=', $this->member_id]], 'status');
|
||||
$res = $apply_model->getFenxiaoApplyInfo([ [ 'member_id', '=', $this->member_id ] ], 'status');
|
||||
return $this->response($res);
|
||||
}
|
||||
|
||||
/**
|
||||
* Common: 用户代理申请基本信息获取
|
||||
* Author: wu-hui
|
||||
* Time: 2023/02/27 10:35
|
||||
* @return false|string
|
||||
*/
|
||||
public function upgradeBase(){
|
||||
// 用户登录
|
||||
$token = $this->checkToken();
|
||||
if ($token['code'] < 0) return $this->response($token);
|
||||
// 获取设置信息
|
||||
$config = (new Config())->getFenxiaoBasicsConfig($this->site_id)['data'];
|
||||
$data['upgrade_agree'] = $config['value']['upgrade_agree'] ?? '';
|
||||
// 获取申请信息
|
||||
$field = "username,phone,id_card,id_card_front,id_card_reverse,status,reject_cause";
|
||||
$data['info'] = (new FenxiaoApply())->getFenXiaoUpgradeApplyInfo([['member_id','=',$this->member_id]],$field)['data'];
|
||||
|
||||
|
||||
return $this->response($this->success($data));
|
||||
}
|
||||
/**
|
||||
* Common: 代理申请信息
|
||||
* Author: wu-hui
|
||||
* Time: 2023/02/27 10:31
|
||||
* @return false|string
|
||||
*/
|
||||
public function upgradeApply(){
|
||||
// 用户登录
|
||||
$token = $this->checkToken();
|
||||
if ($token['code'] < 0) return $this->response($token);
|
||||
$this->params['member_id'] = $token['data']['member_id'];
|
||||
|
||||
return $this->response((new FenxiaoApply())->upgradeApply($this->params));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
|
@ -88,27 +88,6 @@ class Fenxiao extends BaseApi
|
|||
if (!empty($one_in_progress_commission[ 'data' ][ 'commission' ])) $info[ 'data' ][ 'in_progress_money' ] += $one_in_progress_commission[ 'data' ][ 'commission' ];
|
||||
if (!empty($two_in_progress_commission[ 'data' ][ 'commission' ])) $info[ 'data' ][ 'in_progress_money' ] += $two_in_progress_commission[ 'data' ][ 'commission' ];
|
||||
if (!empty($three_in_progress_commission[ 'data' ][ 'commission' ])) $info[ 'data' ][ 'in_progress_money' ] += $three_in_progress_commission[ 'data' ][ 'commission' ];
|
||||
|
||||
// 判断:是否可以申请升级
|
||||
$info['data']['is_apply_upgrade'] = 0;
|
||||
$currentLevelNum = @(int)($info['data']['condition']['fenxiao']['level_num'] ?? 0);
|
||||
$parentLevelId = $info['data']['parent_level_id'] ?? 0;
|
||||
if($currentLevelNum == 0 && $parentLevelId > 0){
|
||||
$parentLevelNum = Db::name('fenxiao_level')->where('level_id',$info['data']['parent_level_id'])->value('level_num');
|
||||
if($parentLevelNum == 1) $info['data']['is_apply_upgrade'] = 1;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
$futures_user_info = model('futures_user')->getInfo([['member_id', '=', $this->member_id]]);
|
||||
|
||||
if(empty($futures_user_info)){
|
||||
$data['member_id'] = $this->member_id;
|
||||
$data['site_id'] = $this->site_id;
|
||||
$data['created_time'] = time();
|
||||
model('futures_user')->add($data);
|
||||
$futures_user_info = model('futures_user')->getInfo([['member_id', '=', $this->member_id]]);
|
||||
}
|
||||
return $this->response($info);
|
||||
}
|
||||
|
|
@ -169,21 +148,16 @@ class Fenxiao extends BaseApi
|
|||
{
|
||||
$token = $this->checkToken();
|
||||
if ($token[ 'code' ] < 0) return $this->response($token);
|
||||
|
||||
$qrcode_param = isset($this->params[ 'qrcode_param' ]) ? $this->params[ 'qrcode_param' ] : '';//二维码
|
||||
|
||||
if (empty($qrcode_param)) {
|
||||
return $this->response($this->error('', 'REQUEST_QRCODE_PARAM'));
|
||||
}
|
||||
|
||||
$qrcode_param = json_decode($qrcode_param, true);
|
||||
$qrcode_param[ 'source_member' ] = $this->member_id;
|
||||
|
||||
$poster = new Poster();
|
||||
$param = $this->params;
|
||||
$param[ 'qrcode_param' ] = $qrcode_param;
|
||||
$res = $poster->getFenxiaoPoster($param);
|
||||
|
||||
return $this->response($res);
|
||||
}
|
||||
|
||||
|
|
@ -217,7 +191,7 @@ class Fenxiao extends BaseApi
|
|||
$page = $this->params[ 'page' ] ?? 1;
|
||||
$page_size = $this->params[ 'page_size' ] ?? PAGE_LIST_ROWS;
|
||||
$level = $this->params[ 'level' ] ?? 1;
|
||||
$is_pay = $this->params['is_pay'] ?? 0;
|
||||
$is_pay = $this->params[ 'is_pay' ] ?? 0;
|
||||
|
||||
$model = new FenxiaoModel();
|
||||
$fenxiao_info = $model->getFenxiaoInfo([ [ 'member_id', '=', $this->member_id ] ], 'fenxiao_id');
|
||||
|
|
@ -303,7 +277,8 @@ class Fenxiao extends BaseApi
|
|||
/**
|
||||
* 排行榜
|
||||
*/
|
||||
public function rankingList(){
|
||||
public function rankingList()
|
||||
{
|
||||
$token = $this->checkToken();
|
||||
if ($token[ 'code' ] < 0) return $this->response($token);
|
||||
|
||||
|
|
@ -314,14 +289,14 @@ class Fenxiao extends BaseApi
|
|||
$model = new FenxiaoModel();
|
||||
|
||||
$condition = [
|
||||
['f.site_id', '=', $this->site_id],
|
||||
['f.is_delete', '=', 0]
|
||||
[ 'f.site_id', '=', $this->site_id ],
|
||||
[ 'f.is_delete', '=', 0 ]
|
||||
];
|
||||
|
||||
$order = $type == 'profit' ? 'f.total_commission desc' : Db::raw('(f.one_child_num + f.one_child_fenxiao_num) desc');
|
||||
$field = 'f.total_commission, (f.one_child_num + f.one_child_fenxiao_num) as child_num, m.nickname,m.headimg';
|
||||
|
||||
$data = $model->getFenxiaoPageLists($condition, $page, $page_size, $order, $field, 'f', [ ['member m', 'm.member_id = f.member_id', 'inner'] ]);
|
||||
$data = $model->getFenxiaoPageLists($condition, $page, $page_size, $order, $field, 'f', [ [ 'member m', 'm.member_id = f.member_id', 'inner' ] ]);
|
||||
|
||||
return $this->response($data);
|
||||
}
|
||||
|
|
@ -343,14 +318,15 @@ class Fenxiao extends BaseApi
|
|||
|
||||
$order = $type == 'profit' ? 'total_commission' : '(one_child_num + one_child_fenxiao_num)';
|
||||
|
||||
$data = $model->getFenxiaoRanking($this->site_id, $fenxiao_info['fenxiao_id'], $order);
|
||||
$data = $model->getFenxiaoRanking($this->site_id, $fenxiao_info[ 'fenxiao_id' ], $order);
|
||||
return $this->response($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 子级分销商
|
||||
*/
|
||||
public function childFenxiao(){
|
||||
public function childFenxiao()
|
||||
{
|
||||
$token = $this->checkToken();
|
||||
if ($token[ 'code' ] < 0) return $this->response($token);
|
||||
|
||||
|
|
@ -361,20 +337,29 @@ class Fenxiao extends BaseApi
|
|||
$fenxiao_info = $model->getFenxiaoInfo([ [ 'member_id', '=', $this->member_id ] ], 'fenxiao_id')[ 'data' ];
|
||||
if (empty($fenxiao_info)) return $this->response($this->error('', 'MEMBER_NOT_IS_FENXIAO'));
|
||||
|
||||
$parent_fenxiao_id = [ $fenxiao_info[ 'fenxiao_id' ] ]; // 上级分销商id集合
|
||||
|
||||
// 查询分销基础配置
|
||||
$config_model = new Config();
|
||||
$fenxiao_basic_config = $config_model->getFenxiaoBasicsConfig($this->site_id)[ 'data' ][ 'value' ];
|
||||
$level = $fenxiao_basic_config[ 'level' ];
|
||||
$self_purchase_rebate = $fenxiao_basic_config['self_purchase_rebate'];
|
||||
|
||||
if ($level == 1 && $self_purchase_rebate) return $this->response($this->success([ 'page_count' => 1, 'count' => 0, 'list' => [] ]));
|
||||
if ($level == 2) {
|
||||
|
||||
// 二级分销商id集合
|
||||
$one_level_fenxiao = model('fenxiao')->getColumn([ [ 'parent', '=', $fenxiao_info[ 'fenxiao_id' ] ] ], 'fenxiao_id');
|
||||
if (!empty($one_level_fenxiao)) {
|
||||
$parent_fenxiao_id = array_merge($parent_fenxiao_id, $one_level_fenxiao);
|
||||
}
|
||||
}
|
||||
|
||||
$condition = [
|
||||
['f.site_id', '=', $this->site_id ],
|
||||
['f.parent', '=', $fenxiao_info['fenxiao_id'] ],
|
||||
['m.is_delete', '=', 0]
|
||||
[ 'f.site_id', '=', $this->site_id ],
|
||||
[ 'f.parent', 'in', $parent_fenxiao_id ],
|
||||
[ 'm.is_delete', '=', 0 ]
|
||||
];
|
||||
$field = 'm.nickname,m.headimg,m.member_id,m.order_num,m.order_money,f.audit_time,f.level_name,m.is_fenxiao,m.bind_fenxiao_time,f.one_child_num,f.one_child_fenxiao_num';
|
||||
$join = [ ['member m', 'm.member_id = f.member_id', 'inner'] ];
|
||||
$field = 'm.nickname,m.headimg,m.member_id,m.order_num,m.order_money,f.fenxiao_id,f.audit_time,f.level_name,m.is_fenxiao,m.bind_fenxiao_time,f.one_child_num,f.one_child_fenxiao_num';
|
||||
$join = [ [ 'member m', 'm.member_id = f.member_id', 'inner' ] ];
|
||||
|
||||
$res = $model->getFenxiaoPageLists($condition, $page, $page_size, 'f.audit_time desc', $field, 'f', $join);
|
||||
return $this->response($res);
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
|
@ -25,14 +25,18 @@ class Goods extends BaseApi
|
|||
|
||||
/**
|
||||
* 分销商品详情
|
||||
* @param int $id
|
||||
* @return false|string
|
||||
*/
|
||||
public function detail()
|
||||
public function detail($id = 0)
|
||||
{
|
||||
$token = $this->checkToken();
|
||||
if ($token[ 'code' ] < 0) return $this->response($token);
|
||||
|
||||
$sku_id = isset($this->params[ 'sku_id' ]) ? $this->params[ 'sku_id' ] : 0;
|
||||
if (!empty($id)) {
|
||||
$sku_id = $id;
|
||||
}
|
||||
if (empty($sku_id)) {
|
||||
return $this->response($this->error('', 'REQUEST_SKU_ID'));
|
||||
}
|
||||
|
|
@ -52,8 +56,8 @@ class Goods extends BaseApi
|
|||
if (empty($fenxiao_info)) return $this->response($this->error());
|
||||
|
||||
$fenxiao_goods_sku_model = new FenxiaoGoodsSkuModel();
|
||||
$sku_commission_info = $fenxiao_goods_sku_model->getSkuFenxiaoCommission($sku_id, $fenxiao_info[ 'level_id' ]);
|
||||
$data[ 'commission_money' ] = $sku_commission_info[ 'data' ];
|
||||
$data[ 'commission_money' ] = $fenxiao_goods_sku_model->getSkuFenxiaoCommission($sku_id, $fenxiao_info[ 'level_id' ])[ 'data' ];
|
||||
|
||||
$basics = $config->getFenxiaoBasicsConfig($this->site_id);
|
||||
$data[ 'is_commission_money' ] = $basics[ 'data' ][ 'value' ][ 'is_commission_money' ];
|
||||
return $this->response($this->success($data));
|
||||
|
|
@ -131,8 +135,8 @@ class Goods extends BaseApi
|
|||
$fenxiao_model = new FenxiaoModel();
|
||||
$fenxiao_info = $fenxiao_model->getFenxiaoInfo([ [ 'member_id', '=', $this->member_id ] ], "fenxiao_id,level_id")[ 'data' ];
|
||||
|
||||
$fenxiao_level = new FenxiaoLevel();
|
||||
$level_info = $fenxiao_level->getLevelInfo([ [ 'level_id', '=', $fenxiao_info[ 'level_id' ] ] ], 'one_rate')[ 'data' ];
|
||||
// $fenxiao_level = new FenxiaoLevel();
|
||||
// $level_info = $fenxiao_level->getLevelInfo([ [ 'level_id', '=', $fenxiao_info[ 'level_id' ] ] ], 'one_rate')[ 'data' ];
|
||||
|
||||
$fenxiao_goods_sku_model = new FenxiaoGoodsSkuModel();
|
||||
$list = $fenxiao_goods_sku_model->getFenxiaoGoodsSkuPageList($condition, $page, $page_size, $order_by);
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
|
@ -14,9 +14,6 @@ namespace addon\fenxiao\api\controller;
|
|||
use app\api\controller\BaseApi;
|
||||
use addon\fenxiao\model\FenxiaoOrder as FenxiaoOrderModel;
|
||||
use addon\fenxiao\model\Fenxiao;
|
||||
use think\Exception;
|
||||
use think\facade\Log;
|
||||
use app\model\order\Order as BaseOrder;
|
||||
|
||||
/**
|
||||
* 分销订单
|
||||
|
|
@ -115,49 +112,4 @@ class Order extends BaseApi
|
|||
return $this->response($list);
|
||||
}
|
||||
|
||||
public function testDaySettlement(){
|
||||
return $this->response(event("DaySettlement"));
|
||||
}
|
||||
|
||||
public function testAreaMonthlyReward(){
|
||||
event("AreaMonthlyReward");
|
||||
return $this->response([]);
|
||||
}
|
||||
|
||||
public function testPointexchangeOrderPayNotify(){
|
||||
return $this->response(event("PointexchangeOrderPayNotify",['out_trade_no'=>'16768593884624691000']));
|
||||
|
||||
$order = new BaseOrder;
|
||||
|
||||
// return $this->response( $order->addOrderLog(["id" => 265,
|
||||
// "site_id" => 1,
|
||||
// "out_trade_no" => "16768593884624691000",
|
||||
// "pay_type" => "POINT",
|
||||
// "trade_no" => "",
|
||||
// "pay_no" => "",
|
||||
// "pay_body" => "测试商品 【商品】",
|
||||
// "pay_detail" => "测试商品 【商品】",
|
||||
// "pay_money" => "0.00",
|
||||
// "pay_addon" => "",
|
||||
// "pay_voucher" => "",
|
||||
// "pay_status" => 2,
|
||||
// "return_url" => "",
|
||||
// "event" => "PointexchangeOrderPayNotify",
|
||||
// "mch_info" => "",
|
||||
// "create_time" => 1676859389,
|
||||
// "pay_time" => 1676859389,
|
||||
// "balance" => "0.00",
|
||||
// "balance_money" => "0.00",
|
||||
// "member_id" => 0,
|
||||
// "pay_json" => "",
|
||||
// "order_id" => 262,
|
||||
// "action" => "商家对订单进行了线下支付",
|
||||
// "order_status" => 1,
|
||||
// "order_status_name" => "待发货"]));
|
||||
}
|
||||
|
||||
public function testPayType(){
|
||||
return $this->response(event('PayType', []));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -353,7 +353,8 @@
|
|||
<!-- 资源 -->
|
||||
<template slot="resource">
|
||||
<js>
|
||||
var fenxiaoResourcePath = "{$resource_path}";
|
||||
var fenxiaoResourcePath = "{$resource_path}"; // http路径
|
||||
var fenxiaoRelativePath = "{$relative_path}"; // 相对路径
|
||||
</js>
|
||||
<css src="{$resource_path}/css/design.css"></css>
|
||||
<js src="{$resource_path}/js/design.js"></js>
|
||||
|
|
|
|||
|
|
@ -1,36 +1,36 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
* =========================================================
|
||||
*/
|
||||
return [
|
||||
|
||||
// 自定义模板页面类型,格式:[ 'title' => '页面类型名称', 'name' => '页面标识', 'path' => '页面路径', 'value' => '页面数据,json格式' ]
|
||||
'template' => [
|
||||
[
|
||||
'title' => '分销市场',
|
||||
'name' => 'DIY_FENXIAO_MARKET',
|
||||
'path' => '/pages_tool/index/diy?name=DIY_FENXIAO_MARKET',
|
||||
'value' => '',
|
||||
]
|
||||
// [
|
||||
// 'title' => '分销市场',
|
||||
// 'name' => 'DIY_FENXIAO_MARKET',
|
||||
// 'path' => '/pages_tool/index/diy?name=DIY_FENXIAO_MARKET',
|
||||
// 'value' => '',
|
||||
// ]
|
||||
],
|
||||
|
||||
// 后台自定义组件——装修
|
||||
'util' => [
|
||||
[
|
||||
'name' => 'FenxiaoGoodsList',
|
||||
'title' => '分销商品',
|
||||
'type' => 'PROMOTION',
|
||||
'value' => '{"style":"style-1","sources":"initial","count":6,"goodsId":[],"nameLineMode":"single","template":"row1-of2","categoryId":0,"categoryName":"请选择","goodsNameStyle":{"color":"#303133","control":true,"fontWeight":false},"imgAroundRadius":0,"btnStyle":{"text":"关注","textColor":"#FFFFFF","theme":"default","aroundRadius":25,"control":true,"support":true,"bgColorStart":"#FC6731","bgColorEnd":"#FF4444"},"priceStyle":{"mainColor":"#FF4444","mainControl":true,"lineColor":"#999CA7","lineControl":true,"lineSupport":true},"ornament":{"type":"default","color":"#EDEDED"},"theme":"default"}',
|
||||
'sort' => '30008',
|
||||
'support_diy_view' => 'DIY_FENXIAO_MARKET',
|
||||
'max_count' => 0,
|
||||
'icon' => 'iconfont iconfenxiaoshangpin'
|
||||
]
|
||||
// [
|
||||
// 'name' => 'FenxiaoGoodsList',
|
||||
// 'title' => '分销商品',
|
||||
// 'type' => 'PROMOTION',
|
||||
// 'value' => '{"style":"style-1","sources":"initial","count":6,"goodsId":[],"nameLineMode":"single","template":"row1-of2","categoryId":0,"categoryName":"请选择","goodsNameStyle":{"color":"#303133","control":true,"fontWeight":false},"imgAroundRadius":0,"btnStyle":{"text":"关注","textColor":"#FFFFFF","theme":"default","aroundRadius":25,"control":true,"support":true,"bgColorStart":"#FC6731","bgColorEnd":"#FF4444"},"priceStyle":{"mainColor":"#FF4444","mainControl":true,"lineColor":"#999CA7","lineControl":true,"lineSupport":true},"ornament":{"type":"default","color":"#EDEDED"},"theme":"default"}',
|
||||
// 'sort' => '30008',
|
||||
// 'support_diy_view' => 'DIY_FENXIAO_MARKET',
|
||||
// 'max_count' => 0,
|
||||
// 'icon' => 'iconfont iconfenxiaoshangpin'
|
||||
// ]
|
||||
],
|
||||
|
||||
// 自定义页面路径
|
||||
|
|
@ -64,17 +64,17 @@ return [
|
|||
'web_url' => '',
|
||||
'sort' => 0
|
||||
],
|
||||
[
|
||||
'name' => 'DISTRIBUTION_MARKET',
|
||||
'title' => '分销市场',
|
||||
'wap_url' => '/pages_tool/index/diy?name=DIY_FENXIAO_MARKET',
|
||||
'web_url' => '',
|
||||
'sort' => 0
|
||||
],
|
||||
// [
|
||||
// 'name' => 'DISTRIBUTION_MARKET',
|
||||
// 'title' => '分销市场',
|
||||
// 'wap_url' => '/pages_tool/index/diy?name=DIY_FENXIAO_MARKET',
|
||||
// 'web_url' => '',
|
||||
// 'sort' => 0
|
||||
// ],
|
||||
[
|
||||
'name' => 'DISTRIBUTION_GOODS',
|
||||
'title' => '分销商品',
|
||||
'wap_url' => '/pages_promotion/fenxiao/follow',
|
||||
'wap_url' => '/pages_promotion/fenxiao/goods_list',
|
||||
'web_url' => '',
|
||||
'sort' => 0
|
||||
],
|
||||
|
|
|
|||
|
|
@ -80,14 +80,7 @@ return [
|
|||
//统计写入
|
||||
'AddStat' => [
|
||||
'addon\fenxiao\event\AddStat',
|
||||
],
|
||||
//每日结算
|
||||
'DaySettlement' => [
|
||||
'addon\fenxiao\event\DaySettlement',
|
||||
],
|
||||
'AreaMonthlyReward'=>[ //区域代理月结
|
||||
'addon\fenxiao\event\AutoAreaMonthlyReward', //区域代理月结
|
||||
],
|
||||
]
|
||||
],
|
||||
|
||||
'subscribe' => [
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
* =========================================================
|
||||
*/
|
||||
return [
|
||||
|
|
@ -14,7 +14,7 @@ return [
|
|||
'type' => 'tool', //插件类型 system :系统插件(自动安装), promotion:扩展营销插件 tool:工具插件
|
||||
'status' => 1,
|
||||
'author' => '',
|
||||
'version' => '5.1.1',
|
||||
'version_no' => '520221115001',
|
||||
'version' => '5.1.7',
|
||||
'version_no' => '520230302001',
|
||||
'content' => '',
|
||||
];
|
||||
|
|
@ -3,280 +3,280 @@
|
|||
// | 店铺端菜单设置
|
||||
// +----------------------------------------------------------------------
|
||||
return [
|
||||
// [
|
||||
// 'name' => 'PROMOTION_FENXIAO',
|
||||
// 'title' => '分销管理',
|
||||
// 'url' => 'fenxiao://shop/fenxiao/index',
|
||||
// 'parent' => 'PROMOTION_CENTER',
|
||||
// 'picture' => 'addon/fenxiao/shop/view/public/img/distribution_new.png',
|
||||
// 'picture_selected' => 'addon/fenxiao/shop/view/public/img/distribution_select.png',
|
||||
// 'is_show' => 1,
|
||||
// 'sort' => 100,
|
||||
// 'child_list' => [
|
||||
// [
|
||||
// 'name' => 'PROMOTION_FENXIAO_INDEX',
|
||||
// 'title' => '分销概况',
|
||||
// 'url' => 'fenxiao://shop/fenxiao/index',
|
||||
// 'is_show' => 1,
|
||||
// 'sort' => 1,
|
||||
// 'child_list' => []
|
||||
// ],
|
||||
// [
|
||||
// 'name' => 'PROMOTION_FENXIAO_GOODS_LIST',
|
||||
// 'title' => '分销商品',
|
||||
// 'url' => 'fenxiao://shop/goods/lists',
|
||||
// 'is_show' => 1,
|
||||
// 'sort' => 2,
|
||||
// 'child_list' => [
|
||||
// [
|
||||
// 'name' => 'PROMOTION_FENXIAO_GOODS_DETAIL',
|
||||
// 'title' => '商品详情',
|
||||
// 'url' => 'fenxiao://shop/goods/detail',
|
||||
// 'is_show' => 0,
|
||||
// ],
|
||||
// [
|
||||
// 'name' => 'PROMOTION_FENXIAO_GOODS_CONFIG',
|
||||
// 'title' => '商品设置',
|
||||
// 'url' => 'fenxiao://shop/goods/config',
|
||||
// 'sort' => 1,
|
||||
// 'is_show' => 0
|
||||
// ],
|
||||
// [
|
||||
// 'name' => 'PROMOTION_FENXIAO_GOODS_MODIFY',
|
||||
// 'title' => '状态设置',
|
||||
// 'url' => 'fenxiao://shop/goods/modify',
|
||||
// 'sort' => 1,
|
||||
// 'is_show' => 0
|
||||
// ],
|
||||
// [
|
||||
// 'name' => 'PROMOTION_FENXIAO_SET_GOODS_IS_FENXIAO',
|
||||
// 'title' => '是否参与分销',
|
||||
// 'url' => 'fenxiao://shop/goods/setGoodsIsFenxiao',
|
||||
// 'sort' => 1,
|
||||
// 'is_show' => 0
|
||||
// ],
|
||||
// ]
|
||||
// ],
|
||||
// [
|
||||
// 'name' => 'PROMOTION_FENXIAO_ROOT',
|
||||
// 'title' => '分销商',
|
||||
// 'url' => 'fenxiao://shop/fenxiao/lists',
|
||||
// 'is_show' => 1,
|
||||
// 'is_control' => 1,
|
||||
// 'sort' => 3,
|
||||
// 'child_list' => [
|
||||
// [
|
||||
// 'name' => 'PROMOTION_FENXIAO_DETAIL',
|
||||
// 'title' => '分销商信息',
|
||||
// 'url' => 'fenxiao://shop/fenxiao/detail',
|
||||
// 'is_show' => 1,
|
||||
// 'is_control' => 1,
|
||||
// ],
|
||||
// [
|
||||
// 'name' => 'PROMOTION_FENXIAO_TEAM',
|
||||
// 'title' => '分销商团队',
|
||||
// 'url' => 'fenxiao://shop/fenxiao/team',
|
||||
// 'is_show' => 1,
|
||||
// 'is_control' => 1,
|
||||
// ],
|
||||
// [
|
||||
// 'name' => 'PROMOTION_FENXIAO_ACCOUNT',
|
||||
// 'title' => '账户明细',
|
||||
// 'url' => 'fenxiao://shop/fenxiao/account',
|
||||
// 'is_show' => 1,
|
||||
// 'is_control' => 1,
|
||||
// ],
|
||||
// [
|
||||
// 'name' => 'PROMOTION_FENXIAO_ORDERMANAGE',
|
||||
// 'title' => '订单管理',
|
||||
// 'url' => 'fenxiao://shop/fenxiao/order',
|
||||
// 'is_show' => 1,
|
||||
// 'is_control' => 1,
|
||||
// ],
|
||||
// [
|
||||
// 'name' => 'PROMOTION_FENXIAO_ORDERMANAGEDETAIL',
|
||||
// 'title' => '订单详情',
|
||||
// 'url' => 'fenxiao://shop/fenxiao/orderdetail',
|
||||
// 'is_show' => 0,
|
||||
// 'is_control' => 1,
|
||||
// ],
|
||||
// [
|
||||
// 'name' => 'PROMOTION_FENXIAO_ADD',
|
||||
// 'title' => '添加分销商',
|
||||
// 'url' => 'fenxiao://shop/fenxiao/add',
|
||||
// 'is_show' => 0,
|
||||
// 'is_control' => 1,
|
||||
// ],
|
||||
// [
|
||||
// 'name' => 'PROMOTION_FENXIAO_FROZEN',
|
||||
// 'title' => '冻结',
|
||||
// 'url' => 'fenxiao://shop/fenxiao/frozen',
|
||||
// 'is_show' => 0,
|
||||
// 'is_control' => 1,
|
||||
// ],
|
||||
// [
|
||||
// 'name' => 'PROMOTION_FENXIAO_UNFROZEN',
|
||||
// 'title' => '恢复正常',
|
||||
// 'url' => 'fenxiao://shop/fenxiao/unfrozen',
|
||||
// 'is_show' => 0,
|
||||
// 'is_control' => 1,
|
||||
// ],
|
||||
// [
|
||||
// 'name' => 'PROMOTION_FENXIAO_CHANGE_LEVEL',
|
||||
// 'title' => '变更上级分销商',
|
||||
// 'url' => 'fenxiao://shop/fenxiao/confirmChange',
|
||||
// 'is_show' => 0,
|
||||
// 'is_control' => 1,
|
||||
// ],
|
||||
// ],
|
||||
// ],
|
||||
// [
|
||||
// 'name' => 'PROMOTION_FENXIAO_APPLY',
|
||||
// 'title' => '分销商申请',
|
||||
// 'url' => 'fenxiao://shop/fenxiao/apply',
|
||||
// 'is_show' => 1,
|
||||
// 'sort' => 4,
|
||||
// 'child_list' => [
|
||||
// [
|
||||
// 'name' => 'PROMOTION_FENXIAO_PASS',
|
||||
// 'title' => '审核通过',
|
||||
// 'url' => 'fenxiao://shop/fenxiao/pass',
|
||||
// 'is_show' => 0,
|
||||
// 'is_control' => 1,
|
||||
// ],
|
||||
// [
|
||||
// 'name' => 'PROMOTION_FENXIAO_REFUSE',
|
||||
// 'title' => '审核拒绝',
|
||||
// 'url' => 'fenxiao://shop/fenxiao/refuse',
|
||||
// 'is_show' => 0,
|
||||
// 'is_control' => 1,
|
||||
// ],
|
||||
// ],
|
||||
// ],
|
||||
// [
|
||||
// 'name' => 'PROMOTION_FENXIAO_ORDER',
|
||||
// 'title' => '分销订单',
|
||||
// 'url' => 'fenxiao://shop/order/lists',
|
||||
// 'is_show' => 1,
|
||||
// 'sort' => 5,
|
||||
// 'child_list' => [
|
||||
// [
|
||||
// 'name' => 'PROMOTION_FENXIAO_ORDER_DETAIL',
|
||||
// 'title' => '订单详情',
|
||||
// 'url' => 'fenxiao://shop/order/detail',
|
||||
// 'sort' => 1,
|
||||
// 'is_show' => 0
|
||||
// ],
|
||||
// ]
|
||||
// ],
|
||||
// [
|
||||
// 'name' => 'PROMOTION_FENXIAO_LEVEL',
|
||||
// 'title' => '分销等级',
|
||||
// 'url' => 'fenxiao://shop/level/lists',
|
||||
// 'is_show' => 1,
|
||||
// 'is_control' => 1,
|
||||
// 'sort' => 6,
|
||||
// 'child_list' => [
|
||||
// [
|
||||
// 'name' => 'PROMOTION_FENXIAO_LEVEL_ADD',
|
||||
// 'title' => '添加等级',
|
||||
// 'url' => 'fenxiao://shop/level/add',
|
||||
// 'is_show' => 0,
|
||||
// ],
|
||||
// [
|
||||
// 'name' => 'PROMOTION_FENXIAO_LEVEL_EDIT',
|
||||
// 'title' => '编辑等级',
|
||||
// 'url' => 'fenxiao://shop/level/edit',
|
||||
// 'is_show' => 0,
|
||||
// ],
|
||||
// [
|
||||
// 'name' => 'PROMOTION_FENXIAO_LEVEL_STATUS',
|
||||
// 'title' => '等级状态设置',
|
||||
// 'url' => 'fenxiao://shop/level/status',
|
||||
// 'is_show' => 0,
|
||||
// ],
|
||||
// [
|
||||
// 'name' => 'PROMOTION_FENXIAO_LEVEL_DELETE',
|
||||
// 'title' => '删除等级',
|
||||
// 'url' => 'fenxiao://shop/level/delete',
|
||||
// 'is_show' => 0,
|
||||
// ]
|
||||
// ]
|
||||
// ],
|
||||
// [
|
||||
// 'name' => 'PROMOTION_FENXIAO_CONFIG',
|
||||
// 'title' => '分销设置',
|
||||
// 'url' => 'fenxiao://shop/config/basics',
|
||||
// 'is_show' => 1,
|
||||
// 'is_control' => 1,
|
||||
// 'sort' => 7,
|
||||
// 'child_list' => [
|
||||
// [
|
||||
// 'name' => 'PROMOTION_FENXIAO_BASICS',
|
||||
// 'title' => '基础设置',
|
||||
// 'url' => 'fenxiao://shop/config/basics',
|
||||
// 'is_show' => 1,
|
||||
// ],
|
||||
// [
|
||||
// 'name' => 'PROMOTION_FENXIAO_AGREEMENT',
|
||||
// 'title' => '申请协议',
|
||||
// 'url' => 'fenxiao://shop/config/agreement',
|
||||
// 'is_show' => 1,
|
||||
// ],
|
||||
// [
|
||||
// 'name' => 'PROMOTION_FENXIAO_SETTLEMENT',
|
||||
// 'title' => '提现设置',
|
||||
// 'url' => 'fenxiao://shop/config/settlement',
|
||||
// 'is_show' => 1,
|
||||
// ],
|
||||
// [
|
||||
// 'name' => 'PROMOTION_FENXIAO_WORDS',
|
||||
// 'title' => '文字设置',
|
||||
// 'url' => 'fenxiao://shop/config/words',
|
||||
// 'is_show' => 1,
|
||||
// ],
|
||||
// [
|
||||
// 'name' => 'PROMOTION_FENXIAO_PEOMOTE_RULE',
|
||||
// 'title' => '推广活动',
|
||||
// 'url' => 'fenxiao://shop/config/promoterule',
|
||||
// 'is_show' => 1,
|
||||
// ]
|
||||
// ]
|
||||
// ],
|
||||
// // [
|
||||
// // 'name' => 'PROMOTION_FENXIAO_MARKET',
|
||||
// // 'title' => '分销市场',
|
||||
// // 'url' => 'fenxiao://shop/market/index',
|
||||
// // 'is_show' => 1,
|
||||
// // 'is_control' => 1,
|
||||
// // 'sort' => 8,
|
||||
// // 'child_list' => []
|
||||
// // ],
|
||||
// [
|
||||
// 'name' => 'PROMOTION_FENXIAO_POSTER_TEMPLATE',
|
||||
// 'title' => '分销海报',
|
||||
// 'url' => 'fenxiao://shop/postertemplate/lists',
|
||||
// 'is_show' => 1,
|
||||
// 'is_control' => 1,
|
||||
// 'sort' => 11,
|
||||
// 'child_list' => [
|
||||
// [
|
||||
// 'name' => 'PROMOTION_FENXIAO_POSTER_TEMPLATE_ADD',
|
||||
// 'title' => '添加海报',
|
||||
// 'url' => 'fenxiao://shop/postertemplate/addpostertemplate',
|
||||
// 'is_show' => 1,
|
||||
// ],
|
||||
// [
|
||||
// 'name' => 'PROMOTION_FENXIAO_POSTER_TEMPLATE_EDIT',
|
||||
// 'title' => '编辑海报',
|
||||
// 'url' => 'fenxiao://shop/postertemplate/editpostertemplate',
|
||||
// 'is_show' => 1,
|
||||
// ]
|
||||
// ]
|
||||
// ],
|
||||
//
|
||||
// ]
|
||||
// ],
|
||||
[
|
||||
'name' => 'PROMOTION_FENXIAO',
|
||||
'title' => '分销管理',
|
||||
'url' => 'fenxiao://shop/fenxiao/index',
|
||||
'parent' => 'PROMOTION_CENTER',
|
||||
'picture' => 'addon/fenxiao/shop/view/public/img/distribution_new.png',
|
||||
'picture_selected' => 'addon/fenxiao/shop/view/public/img/distribution_select.png',
|
||||
'is_show' => 1,
|
||||
'sort' => 100,
|
||||
'child_list' => [
|
||||
[
|
||||
'name' => 'PROMOTION_FENXIAO_INDEX',
|
||||
'title' => '分销概况',
|
||||
'url' => 'fenxiao://shop/fenxiao/index',
|
||||
'is_show' => 1,
|
||||
'sort' => 1,
|
||||
'child_list' => []
|
||||
],
|
||||
[
|
||||
'name' => 'PROMOTION_FENXIAO_ROOT',
|
||||
'title' => '分销商',
|
||||
'url' => 'fenxiao://shop/fenxiao/lists',
|
||||
'is_show' => 1,
|
||||
'is_control' => 1,
|
||||
'sort' => 2,
|
||||
'child_list' => [
|
||||
[
|
||||
'name' => 'PROMOTION_FENXIAO_DETAIL',
|
||||
'title' => '分销商信息',
|
||||
'url' => 'fenxiao://shop/fenxiao/detail',
|
||||
'is_show' => 1,
|
||||
'is_control' => 1,
|
||||
],
|
||||
[
|
||||
'name' => 'PROMOTION_FENXIAO_TEAM',
|
||||
'title' => '分销商团队',
|
||||
'url' => 'fenxiao://shop/fenxiao/team',
|
||||
'is_show' => 1,
|
||||
'is_control' => 1,
|
||||
],
|
||||
[
|
||||
'name' => 'PROMOTION_FENXIAO_ACCOUNT',
|
||||
'title' => '账户明细',
|
||||
'url' => 'fenxiao://shop/fenxiao/account',
|
||||
'is_show' => 1,
|
||||
'is_control' => 1,
|
||||
],
|
||||
[
|
||||
'name' => 'PROMOTION_FENXIAO_ORDERMANAGE',
|
||||
'title' => '订单管理',
|
||||
'url' => 'fenxiao://shop/fenxiao/order',
|
||||
'is_show' => 1,
|
||||
'is_control' => 1,
|
||||
],
|
||||
[
|
||||
'name' => 'PROMOTION_FENXIAO_ORDERMANAGEDETAIL',
|
||||
'title' => '订单详情',
|
||||
'url' => 'fenxiao://shop/fenxiao/orderdetail',
|
||||
'is_show' => 0,
|
||||
'is_control' => 1,
|
||||
],
|
||||
[
|
||||
'name' => 'PROMOTION_FENXIAO_ADD',
|
||||
'title' => '添加分销商',
|
||||
'url' => 'fenxiao://shop/fenxiao/add',
|
||||
'is_show' => 0,
|
||||
'is_control' => 1,
|
||||
],
|
||||
[
|
||||
'name' => 'PROMOTION_FENXIAO_FROZEN',
|
||||
'title' => '冻结',
|
||||
'url' => 'fenxiao://shop/fenxiao/frozen',
|
||||
'is_show' => 0,
|
||||
'is_control' => 1,
|
||||
],
|
||||
[
|
||||
'name' => 'PROMOTION_FENXIAO_UNFROZEN',
|
||||
'title' => '恢复正常',
|
||||
'url' => 'fenxiao://shop/fenxiao/unfrozen',
|
||||
'is_show' => 0,
|
||||
'is_control' => 1,
|
||||
],
|
||||
[
|
||||
'name' => 'PROMOTION_FENXIAO_CHANGE_LEVEL',
|
||||
'title' => '变更上级分销商',
|
||||
'url' => 'fenxiao://shop/fenxiao/confirmChange',
|
||||
'is_show' => 0,
|
||||
'is_control' => 1,
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'name' => 'PROMOTION_FENXIAO_APPLY',
|
||||
'title' => '分销商申请',
|
||||
'url' => 'fenxiao://shop/fenxiao/apply',
|
||||
'is_show' => 1,
|
||||
'sort' => 3,
|
||||
'child_list' => [
|
||||
[
|
||||
'name' => 'PROMOTION_FENXIAO_PASS',
|
||||
'title' => '审核通过',
|
||||
'url' => 'fenxiao://shop/fenxiao/pass',
|
||||
'is_show' => 0,
|
||||
'is_control' => 1,
|
||||
],
|
||||
[
|
||||
'name' => 'PROMOTION_FENXIAO_REFUSE',
|
||||
'title' => '审核拒绝',
|
||||
'url' => 'fenxiao://shop/fenxiao/refuse',
|
||||
'is_show' => 0,
|
||||
'is_control' => 1,
|
||||
],
|
||||
],
|
||||
],
|
||||
[
|
||||
'name' => 'PROMOTION_FENXIAO_GOODS_LIST',
|
||||
'title' => '分销商品',
|
||||
'url' => 'fenxiao://shop/goods/lists',
|
||||
'is_show' => 1,
|
||||
'sort' => 4,
|
||||
'child_list' => [
|
||||
[
|
||||
'name' => 'PROMOTION_FENXIAO_GOODS_DETAIL',
|
||||
'title' => '商品详情',
|
||||
'url' => 'fenxiao://shop/goods/detail',
|
||||
'is_show' => 0,
|
||||
],
|
||||
[
|
||||
'name' => 'PROMOTION_FENXIAO_GOODS_CONFIG',
|
||||
'title' => '商品设置',
|
||||
'url' => 'fenxiao://shop/goods/config',
|
||||
'sort' => 1,
|
||||
'is_show' => 0
|
||||
],
|
||||
[
|
||||
'name' => 'PROMOTION_FENXIAO_GOODS_MODIFY',
|
||||
'title' => '状态设置',
|
||||
'url' => 'fenxiao://shop/goods/modify',
|
||||
'sort' => 1,
|
||||
'is_show' => 0
|
||||
],
|
||||
[
|
||||
'name' => 'PROMOTION_FENXIAO_SET_GOODS_IS_FENXIAO',
|
||||
'title' => '是否参与分销',
|
||||
'url' => 'fenxiao://shop/goods/setGoodsIsFenxiao',
|
||||
'sort' => 1,
|
||||
'is_show' => 0
|
||||
],
|
||||
]
|
||||
],
|
||||
[
|
||||
'name' => 'PROMOTION_FENXIAO_ORDER',
|
||||
'title' => '分销订单',
|
||||
'url' => 'fenxiao://shop/order/lists',
|
||||
'is_show' => 1,
|
||||
'sort' => 5,
|
||||
'child_list' => [
|
||||
[
|
||||
'name' => 'PROMOTION_FENXIAO_ORDER_DETAIL',
|
||||
'title' => '订单详情',
|
||||
'url' => 'fenxiao://shop/order/detail',
|
||||
'sort' => 1,
|
||||
'is_show' => 0
|
||||
],
|
||||
]
|
||||
],
|
||||
[
|
||||
'name' => 'PROMOTION_FENXIAO_LEVEL',
|
||||
'title' => '分销等级',
|
||||
'url' => 'fenxiao://shop/level/lists',
|
||||
'is_show' => 1,
|
||||
'is_control' => 1,
|
||||
'sort' => 6,
|
||||
'child_list' => [
|
||||
[
|
||||
'name' => 'PROMOTION_FENXIAO_LEVEL_ADD',
|
||||
'title' => '添加等级',
|
||||
'url' => 'fenxiao://shop/level/add',
|
||||
'is_show' => 0,
|
||||
],
|
||||
[
|
||||
'name' => 'PROMOTION_FENXIAO_LEVEL_EDIT',
|
||||
'title' => '编辑等级',
|
||||
'url' => 'fenxiao://shop/level/edit',
|
||||
'is_show' => 0,
|
||||
],
|
||||
[
|
||||
'name' => 'PROMOTION_FENXIAO_LEVEL_STATUS',
|
||||
'title' => '等级状态设置',
|
||||
'url' => 'fenxiao://shop/level/status',
|
||||
'is_show' => 0,
|
||||
],
|
||||
[
|
||||
'name' => 'PROMOTION_FENXIAO_LEVEL_DELETE',
|
||||
'title' => '删除等级',
|
||||
'url' => 'fenxiao://shop/level/delete',
|
||||
'is_show' => 0,
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
'name' => 'PROMOTION_FENXIAO_CONFIG',
|
||||
'title' => '分销设置',
|
||||
'url' => 'fenxiao://shop/config/basics',
|
||||
'is_show' => 1,
|
||||
'is_control' => 1,
|
||||
'sort' => 7,
|
||||
'child_list' => [
|
||||
[
|
||||
'name' => 'PROMOTION_FENXIAO_BASICS',
|
||||
'title' => '基础设置',
|
||||
'url' => 'fenxiao://shop/config/basics',
|
||||
'is_show' => 1,
|
||||
],
|
||||
[
|
||||
'name' => 'PROMOTION_FENXIAO_AGREEMENT',
|
||||
'title' => '申请协议',
|
||||
'url' => 'fenxiao://shop/config/agreement',
|
||||
'is_show' => 1,
|
||||
],
|
||||
[
|
||||
'name' => 'PROMOTION_FENXIAO_SETTLEMENT',
|
||||
'title' => '提现设置',
|
||||
'url' => 'fenxiao://shop/config/settlement',
|
||||
'is_show' => 1,
|
||||
],
|
||||
[
|
||||
'name' => 'PROMOTION_FENXIAO_WORDS',
|
||||
'title' => '文字设置',
|
||||
'url' => 'fenxiao://shop/config/words',
|
||||
'is_show' => 1,
|
||||
],
|
||||
[
|
||||
'name' => 'PROMOTION_FENXIAO_PEOMOTE_RULE',
|
||||
'title' => '推广活动',
|
||||
'url' => 'fenxiao://shop/config/promoterule',
|
||||
'is_show' => 1,
|
||||
]
|
||||
]
|
||||
],
|
||||
// [
|
||||
// 'name' => 'PROMOTION_FENXIAO_MARKET',
|
||||
// 'title' => '分销市场',
|
||||
// 'url' => 'fenxiao://shop/market/index',
|
||||
// 'is_show' => 1,
|
||||
// 'is_control' => 1,
|
||||
// 'sort' => 8,
|
||||
// 'child_list' => []
|
||||
// ],
|
||||
[
|
||||
'name' => 'PROMOTION_FENXIAO_POSTER_TEMPLATE',
|
||||
'title' => '分销海报',
|
||||
'url' => 'fenxiao://shop/postertemplate/lists',
|
||||
'is_show' => 1,
|
||||
'is_control' => 1,
|
||||
'sort' => 11,
|
||||
'child_list' => [
|
||||
[
|
||||
'name' => 'PROMOTION_FENXIAO_POSTER_TEMPLATE_ADD',
|
||||
'title' => '添加海报',
|
||||
'url' => 'fenxiao://shop/postertemplate/addpostertemplate',
|
||||
'is_show' => 1,
|
||||
],
|
||||
[
|
||||
'name' => 'PROMOTION_FENXIAO_POSTER_TEMPLATE_EDIT',
|
||||
'title' => '编辑海报',
|
||||
'url' => 'fenxiao://shop/postertemplate/editpostertemplate',
|
||||
'is_show' => 1,
|
||||
]
|
||||
]
|
||||
],
|
||||
|
||||
]
|
||||
],
|
||||
[
|
||||
'name' => 'PROMOTION_FENXIAO_WITHDRAW',
|
||||
'title' => '分销提现',
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用。
|
||||
* 任何企业和个人不允许对程序代码以任何形式任何目的再发布。
|
||||
* =========================================================
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,23 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* SAAS应用系统 --- 十年开发经验汇集巨献!
|
||||
* ==========================================================
|
||||
* Copy right 2020-2050 成都众联思索科技有限公司,保留所有权利。
|
||||
* ----------------------------------------------------------
|
||||
* 官方网址: https://www.zoomtk.com
|
||||
* 这不是自由软件!未经允许不得用于商业目或程序代码摘取及修改。
|
||||
* 任何企业和个人未经允许对程序代码以任何形式任何目的再发布传播。
|
||||
* 唯一发布渠道www.zoomtk.com;非官方渠道统一视为侵权行为。
|
||||
* ==========================================================
|
||||
*/
|
||||
namespace addon\fenxiao\event;
|
||||
use addon\fenxiao\model\FenxiaoOrder;
|
||||
class AutoAreaMonthlyReward
|
||||
{
|
||||
public function handle()
|
||||
{
|
||||
$fenxiao_order_model = new FenxiaoOrder();
|
||||
$res = $fenxiao_order_model->areaMonthlySettlement();
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,30 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\fenxiao\event;
|
||||
|
||||
use addon\fenxiao\model\FenxiaoOrder;
|
||||
|
||||
/**
|
||||
* 每日结算
|
||||
*/
|
||||
class DaySettlement
|
||||
{
|
||||
/**
|
||||
* 每日结算
|
||||
* @param $param
|
||||
*/
|
||||
public function handle($param)
|
||||
{
|
||||
$fenxiao_order_model = new FenxiaoOrder();
|
||||
return $fenxiao_order_model->daySettlement();
|
||||
}
|
||||
}
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,11 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
|
@ -26,7 +25,7 @@ class MemberCancel
|
|||
public function handle($param)
|
||||
{
|
||||
$fenxiao_model = new Fenxiao();
|
||||
$res = $fenxiao_model->CronMemberCancel($param['member_id'],$param['site_id']);
|
||||
$res = $fenxiao_model->CronMemberCancel($param[ 'member_id' ], $param[ 'site_id' ]);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
|
@ -26,7 +26,7 @@ class OrderGoodsRefund
|
|||
public function handle($data)
|
||||
{
|
||||
$order_model = new FenxiaoOrder();
|
||||
$res = $order_model->refund($data);
|
||||
$res = $order_model->refund($data[ 'order_goods_id' ]);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
|
@ -27,16 +27,13 @@ class OrderPay
|
|||
{
|
||||
//先检测是否需要绑定上下线
|
||||
$fenxiao_model = new FenxiaoModel();
|
||||
|
||||
$fenxiao_model->bindRelation([
|
||||
'site_id' => $order['site_id'],
|
||||
'member_id' => $order['member_id'],
|
||||
'action' => 'order_pay',
|
||||
]);
|
||||
|
||||
// 自动成为分销商
|
||||
$fenxiao_model->autoBecomeFenxiao($order['member_id'], $order['site_id']);
|
||||
|
||||
$fenxiao_order = new FenxiaoOrder();
|
||||
return $fenxiao_order->calculate($order);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,125 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* SAAS应用系统 --- 十年开发经验汇集巨献!
|
||||
* ==========================================================
|
||||
* Copy right 2020-2050 成都众联思索科技有限公司,保留所有权利。
|
||||
* ----------------------------------------------------------
|
||||
* 官方网址: https://www.zoomtk.com
|
||||
* 这不是自由软件!未经允许不得用于商业目或程序代码摘取及修改。
|
||||
* 任何企业和个人未经允许对程序代码以任何形式任何目的再发布传播。
|
||||
* 唯一发布渠道www.zoomtk.com;非官方渠道统一视为侵权行为。
|
||||
* ==========================================================
|
||||
*/
|
||||
namespace addon\fenxiao\model;
|
||||
use app\model\BaseModel;
|
||||
class Ageen extends BaseModel
|
||||
{
|
||||
/**
|
||||
* 添加分销等级
|
||||
* @param $data
|
||||
* @return array
|
||||
*/
|
||||
public function add($data)
|
||||
{
|
||||
$data['create_time'] = time();
|
||||
// $data['status'] = 1;
|
||||
$res = model('fenxiao_agent')->add($data);
|
||||
return $this->success($res);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑分销等级
|
||||
* @param $data
|
||||
* @param array $condition
|
||||
* @return array
|
||||
*/
|
||||
public function edit($data, $condition = [])
|
||||
{
|
||||
$data['update_time'] = time();
|
||||
$res = model('fenxiao_agent')->update($data, $condition);
|
||||
return $this->success($res);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分销等级
|
||||
* @param array $condition
|
||||
* @return array
|
||||
*/
|
||||
public function delete($id)
|
||||
{
|
||||
$fenxiao_model = new Fenxiao();
|
||||
$res = model('fenxiao_agent')->delete([['id', '=', $id]]);
|
||||
return $this->success($res);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分销等级信息
|
||||
* @param array $condition
|
||||
* @param string $field
|
||||
* @return array
|
||||
*/
|
||||
public function getInfo($condition = [], $field = '*')
|
||||
{
|
||||
$res = model('fenxiao_agent')->getInfo($condition, $field);
|
||||
return $this->success($res);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $condition
|
||||
* @param string $field
|
||||
* @return array
|
||||
*/
|
||||
public function getColumn($condition = [], $field = 'level_id')
|
||||
{
|
||||
$list = model('fenxiao_agent')->getColumn($condition, $field);
|
||||
return $this->success($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分销商等级列表
|
||||
* @param array $condition
|
||||
* @param string $field
|
||||
* @param string $order
|
||||
* @param string $limit
|
||||
*/
|
||||
public function getList($condition = [], $field = '*', $order = '', $limit = null)
|
||||
{
|
||||
$list = model('fenxiao_agent')->getList($condition, $field, $order, '', '', '', $limit);
|
||||
return $this->success($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分销商等级分页列表
|
||||
* @param array $condition
|
||||
* @param number $page
|
||||
* @param string $page_size
|
||||
* @param string $order
|
||||
* @param string $field
|
||||
*/
|
||||
public function getPageList($condition = [], $page = 1, $page_size = PAGE_LIST_ROWS, $order = '', $field = '*')
|
||||
{
|
||||
$condition[] = [ 'f.is_delete', '=', 0 ];
|
||||
$field = 'f.*,pf.fenxiao_name as parent_name,m.username,m.nickname,m.mobile as member_mobile,m.headimg,a.agent_level_id,a.agent_level_name,a.id';
|
||||
$alias = 'a';
|
||||
$join = [
|
||||
[
|
||||
'fenxiao f',
|
||||
'a.fenxiao_id = f.fenxiao_id',
|
||||
'left'
|
||||
],
|
||||
[
|
||||
'fenxiao pf',
|
||||
'pf.fenxiao_id = f.parent',
|
||||
'left'
|
||||
],
|
||||
[
|
||||
'member m',
|
||||
'm.member_id = f.member_id',
|
||||
'left'
|
||||
],
|
||||
];
|
||||
$list = model('fenxiao_agent')->pageList($condition, $field, $order, $page, $page_size, $alias, $join);
|
||||
// $list = model('fenxiao_agent')->pageList($condition, $field, $order, $page, $page_size);
|
||||
return $this->success($list);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,140 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* SAAS应用系统 --- 十年开发经验汇集巨献!
|
||||
* ==========================================================
|
||||
* Copy right 2020-2050 成都众联思索科技有限公司,保留所有权利。
|
||||
* ----------------------------------------------------------
|
||||
* 官方网址: https://www.zoomtk.com
|
||||
* 这不是自由软件!未经允许不得用于商业目或程序代码摘取及修改。
|
||||
* 任何企业和个人未经允许对程序代码以任何形式任何目的再发布传播。
|
||||
* 唯一发布渠道www.zoomtk.com;非官方渠道统一视为侵权行为。
|
||||
* ==========================================================
|
||||
*/
|
||||
namespace addon\fenxiao\model;
|
||||
use app\model\BaseModel;
|
||||
class AgeenLevel extends BaseModel
|
||||
{
|
||||
/**
|
||||
* 添加分销等级
|
||||
* @param $data
|
||||
* @return array
|
||||
*/
|
||||
public function addLevel($data)
|
||||
{
|
||||
$data['create_time'] = time();
|
||||
$data['status'] = 1;
|
||||
$res = model('fenxiao_agent_level')->add($data);
|
||||
return $this->success($res);
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑分销等级
|
||||
* @param $data
|
||||
* @param array $condition
|
||||
* @return array
|
||||
*/
|
||||
public function editLevel($data, $condition = [])
|
||||
{
|
||||
$data['update_time'] = time();
|
||||
$res = model('fenxiao_agent_level')->update($data, $condition);
|
||||
if ($res) {
|
||||
if (isset($data['level_name']) && $data['level_name'] != '') {
|
||||
$condition[0][0] = 'agent_level_id';
|
||||
model('fenxiao')->update(['agent_level_name' => $data['level_name']], $condition);
|
||||
}
|
||||
}
|
||||
return $this->success($res);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分销等级
|
||||
* @param array $condition
|
||||
* @return array
|
||||
*/
|
||||
public function deleteLevel($level_id, $site_id)
|
||||
{
|
||||
$fenxiao_model = new Fenxiao();
|
||||
$fenxiao_list = $fenxiao_model->getFenxiaoList([['agent_level_id', '=', $level_id]], 'fenxiao_id');
|
||||
if (empty($fenxiao_list['data'])) {
|
||||
$res = model('fenxiao_agent_level')->delete([['level_id', '=', $level_id], ['site_id', '=', $site_id]]);
|
||||
return $this->success($res);
|
||||
} else {
|
||||
return $this->error('', '该分销等级存在其他分销商,无法删除');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分销等级信息
|
||||
* @param array $condition
|
||||
* @param string $field
|
||||
* @return array
|
||||
*/
|
||||
public function getLevelInfo($condition = [], $field = '*')
|
||||
{
|
||||
$res = model('fenxiao_agent_level')->getInfo($condition, $field);
|
||||
return $this->success($res);
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $condition
|
||||
* @param string $field
|
||||
* @return array
|
||||
*/
|
||||
public function getLevelColumn($condition = [], $field = 'level_id')
|
||||
{
|
||||
$list = model('fenxiao_agent_level')->getColumn($condition, $field);
|
||||
return $this->success($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分销商等级列表
|
||||
* @param array $condition
|
||||
* @param string $field
|
||||
* @param string $order
|
||||
* @param string $limit
|
||||
*/
|
||||
public function getLevelList($condition = [], $field = '*', $order = '', $limit = null)
|
||||
{
|
||||
$list = model('fenxiao_agent_level')->getList($condition, $field, $order, '', '', '', $limit);
|
||||
return $this->success($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取分销商等级分页列表
|
||||
* @param array $condition
|
||||
* @param number $page
|
||||
* @param string $page_size
|
||||
* @param string $order
|
||||
* @param string $field
|
||||
*/
|
||||
public function getLevelPageList($condition = [], $page = 1, $page_size = PAGE_LIST_ROWS, $order = '', $field = '*')
|
||||
{
|
||||
$list = model('fenxiao_agent_level')->pageList($condition, $field, $order, $page, $page_size);
|
||||
return $this->success($list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取最低的分销商等级
|
||||
* @param array $condition
|
||||
* @param string $field
|
||||
* @return array
|
||||
*/
|
||||
public function getMinLevel($condition = [], $field = '*')
|
||||
{
|
||||
$info = model('fenxiao_agent_level')->getFirstData($condition, $field, 'level_num asc,one_rate asc');
|
||||
return $this->success($info);
|
||||
}
|
||||
|
||||
/**
|
||||
* 某项排序的第一个
|
||||
* @param $condition
|
||||
* @param $field
|
||||
* @param $order
|
||||
* @return array
|
||||
*/
|
||||
public function getLevelFirst($condition, $field, $order)
|
||||
{
|
||||
$first = model('fenxiao_agent_level')->getFirstData($condition, $field, $order);
|
||||
return $this->success($first);
|
||||
}
|
||||
}
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
|
@ -31,50 +31,36 @@ class Config extends BaseModel
|
|||
|
||||
//分销基本设置
|
||||
$basics_data = [
|
||||
'level' => $data['level'],//分销层级
|
||||
'internal_buy' => $data['internal_buy'],//分销内购
|
||||
'is_examine' => $data['is_examine'],//是否需要审核
|
||||
'self_purchase_rebate' => $data['self_purchase_rebate'],//是否开启分销商自购返佣
|
||||
'is_apply' => $data['is_apply'],//是否开启分销申请
|
||||
'is_commission_money' => $data['is_commission_money'],//是否开启商品详情一级佣金
|
||||
'newuser_points' => $data['newuser_points'],
|
||||
'order_give_points_ratio' => $data['order_give_points_ratio'],
|
||||
'order_give_contribution_ratio' => $data['order_give_contribution_ratio'],
|
||||
'order_give_house_purchase_ratio' => $data['order_give_house_purchase_ratio'],
|
||||
'order_give_a_points_ratio' => $data['order_give_a_points_ratio'],
|
||||
'order_give_a_contribution_ratio' => $data['order_give_a_contribution_ratio'],
|
||||
'order_give_d_points_ratio' => $data['order_give_d_points_ratio'],
|
||||
'order_give_d_contribution_ratio' => $data['order_give_d_contribution_ratio'],
|
||||
'no_contribution_points_ratio' => $data['no_contribution_points_ratio'],
|
||||
'contribution_points_ratio' => $data['contribution_points_ratio'],
|
||||
'settlement_points_to_balance_money_ratio' => $data['settlement_points_to_balance_money_ratio'],
|
||||
'settlement_points_to_point_ratio' => $data['settlement_points_to_point_ratio'],
|
||||
// 'violation_unpaid' => $data['violation_unpaid'],
|
||||
// 'violation_hour' => $data['violation_hour'],
|
||||
'level' => $data[ 'level' ],//分销层级
|
||||
'internal_buy' => $data[ 'internal_buy' ],//分销内购
|
||||
'is_examine' => $data[ 'is_examine' ],//是否需要审核
|
||||
'self_purchase_rebate' => $data[ 'self_purchase_rebate' ],//是否开启分销商自购返佣
|
||||
'is_apply' => $data[ 'is_apply' ],//是否开启分销申请
|
||||
'is_commission_money' => $data[ 'is_commission_money' ],//是否开启商品详情一级佣金
|
||||
'upgrade_agree' => $data['upgrade_agree'],
|
||||
];
|
||||
$config->setConfig($basics_data, '分销基本配置', $is_use, [['site_id', '=', $site_id], ['app_module', '=', 'shop'], ['config_key', '=', 'FENXIAO_BASICS_CONFIG']]);
|
||||
$config->setConfig($basics_data, '分销基本配置', $is_use, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', 'shop' ], [ 'config_key', '=', 'FENXIAO_BASICS_CONFIG' ] ]);
|
||||
//分销商设置
|
||||
$fenxiao_data = [
|
||||
'fenxiao_condition' => $data['fenxiao_condition'],//成为分销商条件(0无条件 1申请 2消费次数 3消费金额 4购买商品)
|
||||
'consume_count' => $data['consume_count'],//消费次数
|
||||
'consume_money' => $data['consume_money'],//3消费金额
|
||||
'goods_ids' => $data['goods_ids'],//指定商品id
|
||||
'consume_condition' => $data['consume_condition'],//消费条件(1付款后 2订单完成)
|
||||
'perfect_info' => $data['perfect_info'],//完善资料
|
||||
'fenxiao_condition' => $data[ 'fenxiao_condition' ],//成为分销商条件(0无条件 1申请 2消费次数 3消费金额 4购买商品)
|
||||
'consume_count' => $data[ 'consume_count' ],//消费次数
|
||||
'consume_money' => $data[ 'consume_money' ],//3消费金额
|
||||
'goods_ids' => $data[ 'goods_ids' ],//指定商品id
|
||||
'consume_condition' => $data[ 'consume_condition' ],//消费条件(1付款后 2订单完成)
|
||||
'perfect_info' => $data[ 'perfect_info' ],//完善资料
|
||||
];
|
||||
$config->setConfig($fenxiao_data, '分销商配置', $is_use, [['site_id', '=', $site_id], ['app_module', '=', 'shop'], ['config_key', '=', 'FENXIAO_CONFIG']]);
|
||||
$config->setConfig($fenxiao_data, '分销商配置', $is_use, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', 'shop' ], [ 'config_key', '=', 'FENXIAO_CONFIG' ] ]);
|
||||
// 分销默认等级佣金比率
|
||||
(new FenxiaoLevel())->editLevel([
|
||||
'one_rate' => $data['one_rate'],
|
||||
'two_rate' => $data['two_rate'],
|
||||
'three_rate' => $data['three_rate']
|
||||
], [ ['site_id', '=', $site_id], ['is_default', '=', 1] ]);
|
||||
( new FenxiaoLevel() )->editLevel([
|
||||
'one_rate' => $data[ 'one_rate' ],
|
||||
'two_rate' => $data[ 'two_rate' ],
|
||||
'three_rate' => $data[ 'three_rate' ]
|
||||
], [ [ 'site_id', '=', $site_id ], [ 'is_default', '=', 1 ] ]);
|
||||
//上下级关系
|
||||
$relation_data = [
|
||||
'child_condition' => $data['child_condition'],//成为下线条件
|
||||
'child_condition' => $data[ 'child_condition' ],//成为下线条件
|
||||
];
|
||||
$res = $config->setConfig($relation_data, '分销上下级关系配置', $is_use, [['site_id', '=', $site_id], ['app_module', '=', 'shop'], ['config_key', '=', 'FENXIAO_RELATION_CONFIG']]);
|
||||
$res = $config->setConfig($relation_data, '分销上下级关系配置', $is_use, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', 'shop' ], [ 'config_key', '=', 'FENXIAO_RELATION_CONFIG' ] ]);
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
|
@ -86,21 +72,21 @@ class Config extends BaseModel
|
|||
public function getFenxiaoBasicsConfig($site_id)
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', 'shop'], ['config_key', '=', 'FENXIAO_BASICS_CONFIG']]);
|
||||
$res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', 'shop' ], [ 'config_key', '=', 'FENXIAO_BASICS_CONFIG' ] ]);
|
||||
|
||||
if (empty($res['data']['value'])) {
|
||||
$res['data']['value'] = [
|
||||
'level' => 2,//分销层级
|
||||
if (empty($res[ 'data' ][ 'value' ])) {
|
||||
$res[ 'data' ][ 'value' ] = [
|
||||
'level' => 2,//分销层级
|
||||
'internal_buy' => 0,//分销内购
|
||||
'is_examine' => 0,//是否需要审核
|
||||
'is_apply' => 0,//分销商申请方式
|
||||
'is_commission_money' => 1,//是否开启商品详情一级佣金
|
||||
'is_examine' => 0,//是否需要审核
|
||||
'is_apply' => 0,//分销商申请方式
|
||||
'is_commission_money' => 1,//是否开启商品详情一级佣金
|
||||
];
|
||||
}
|
||||
$res['data']['value']['is_commission_money'] = $res['data']['value']['is_commission_money'] ?? 1;
|
||||
$res['data']['value']['self_purchase_rebate'] = $res['data']['value']['self_purchase_rebate'] ?? 1;
|
||||
$res['data']['value']['is_apply'] = $res['data']['value']['is_apply'] ?? 1;
|
||||
$res['data']['value']['level'] = $res['data']['value']['level'] == 3 ? 2 : $res['data']['value']['level'];
|
||||
$res[ 'data' ][ 'value' ][ 'is_commission_money' ] = $res[ 'data' ][ 'value' ][ 'is_commission_money' ] ?? 1;
|
||||
$res[ 'data' ][ 'value' ][ 'self_purchase_rebate' ] = $res[ 'data' ][ 'value' ][ 'self_purchase_rebate' ] ?? 1;
|
||||
$res[ 'data' ][ 'value' ][ 'is_apply' ] = $res[ 'data' ][ 'value' ][ 'is_apply' ] ?? 1;
|
||||
$res[ 'data' ][ 'value' ][ 'level' ] = $res[ 'data' ][ 'value' ][ 'level' ] == 3 ? 2 : $res[ 'data' ][ 'value' ][ 'level' ];
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
|
@ -111,19 +97,19 @@ class Config extends BaseModel
|
|||
public function getFenxiaoConfig($site_id)
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', 'shop'], ['config_key', '=', 'FENXIAO_CONFIG']]);
|
||||
if (empty($res['data']['value'])) {
|
||||
$res['data']['value'] = [
|
||||
$res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', 'shop' ], [ 'config_key', '=', 'FENXIAO_CONFIG' ] ]);
|
||||
if (empty($res[ 'data' ][ 'value' ])) {
|
||||
$res[ 'data' ][ 'value' ] = [
|
||||
'fenxiao_condition' => 0,//成为分销商条件(0无条件 2消费次数 3消费金额 4购买商品)
|
||||
//申请
|
||||
'is_agreement' => 0,//显示申请协议
|
||||
'agreement_title' => '',//协议标题
|
||||
'is_agreement' => 0,//显示申请协议
|
||||
'agreement_title' => '',//协议标题
|
||||
'agreement_content' => '',//协议内容
|
||||
'consume_count' => 0,//消费次数
|
||||
'consume_money' => 0,//消费次数
|
||||
'consume_count' => 0,//消费次数
|
||||
'consume_money' => 0,//消费次数
|
||||
'consume_condition' => 1,//消费条件(1付款后 2订单完成)
|
||||
'img' => '',//申请页面顶部图片
|
||||
'perfect_info' => '',//完善资料
|
||||
'img' => '',//申请页面顶部图片
|
||||
'perfect_info' => '',//完善资料
|
||||
];
|
||||
|
||||
}
|
||||
|
|
@ -136,9 +122,9 @@ class Config extends BaseModel
|
|||
public function getFenxiaoRelationConfig($site_id)
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', 'shop'], ['config_key', '=', 'FENXIAO_RELATION_CONFIG']]);
|
||||
if (empty($res['data']['value'])) {
|
||||
$res['data']['value'] = [
|
||||
$res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', 'shop' ], [ 'config_key', '=', 'FENXIAO_RELATION_CONFIG' ] ]);
|
||||
if (empty($res[ 'data' ][ 'value' ])) {
|
||||
$res[ 'data' ][ 'value' ] = [
|
||||
'child_condition' => 1,//成为下线条件 1:首次点击分享链接 2:首次下单 3:首次付款
|
||||
];
|
||||
}
|
||||
|
|
@ -157,13 +143,13 @@ class Config extends BaseModel
|
|||
$config = new ConfigModel();
|
||||
|
||||
$agreement_config = [
|
||||
'is_agreement' => $data['is_agreement'],//是否显示申请协议
|
||||
'img' => $data['img'],//申请页面顶部图片
|
||||
'is_agreement' => $data[ 'is_agreement' ],//是否显示申请协议
|
||||
'img' => $data[ 'img' ],//申请页面顶部图片
|
||||
];
|
||||
$res = $config->setConfig($agreement_config, '分销协议配置', $is_use, [['site_id', '=', $site_id], ['app_module', '=', 'shop'], ['config_key', '=', 'FENXIAO_AGREEMENT_CONFIG']]);
|
||||
$res = $config->setConfig($agreement_config, '分销协议配置', $is_use, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', 'shop' ], [ 'config_key', '=', 'FENXIAO_AGREEMENT_CONFIG' ] ]);
|
||||
|
||||
$document = new Document();
|
||||
$document->setDocument($data['agreement_title'], $data['agreement_content'], [['site_id', '=', $site_id], ['app_module', '=', 'shop'], ['document_key', '=', "FENXIAO_AGREEMENT"]]);
|
||||
$document->setDocument($data[ 'agreement_title' ], $data[ 'agreement_content' ], [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', 'shop' ], [ 'document_key', '=', "FENXIAO_AGREEMENT" ] ]);
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
|
@ -175,11 +161,11 @@ class Config extends BaseModel
|
|||
public function getFenxiaoAgreementConfig($site_id)
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', 'shop'], ['config_key', '=', 'FENXIAO_AGREEMENT_CONFIG']]);
|
||||
if (empty($res['data']['value'])) {
|
||||
$res['data']['value'] = [
|
||||
$res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', 'shop' ], [ 'config_key', '=', 'FENXIAO_AGREEMENT_CONFIG' ] ]);
|
||||
if (empty($res[ 'data' ][ 'value' ])) {
|
||||
$res[ 'data' ][ 'value' ] = [
|
||||
'is_agreement' => 0,//显示申请协议
|
||||
'img' => 'public/static/img/fenxiao/apply_top_gg.png',//申请页面顶部图片
|
||||
'img' => 'public/static/img/fenxiao/apply_top_gg.png',//申请页面顶部图片
|
||||
];
|
||||
}
|
||||
return $res;
|
||||
|
|
@ -200,28 +186,27 @@ class Config extends BaseModel
|
|||
$config = new ConfigModel();
|
||||
//分销商结算配置
|
||||
$settlement_data = [
|
||||
'account_type' => $data['account_type'],//佣金计算方式
|
||||
'account_type' => $data[ 'account_type' ],//佣金计算方式
|
||||
];
|
||||
|
||||
$config->setConfig($settlement_data, '分销结算配置', $is_use, [['site_id', '=', $site_id], ['app_module', '=', 'shop'], ['config_key', '=', 'FENXIAO_SETTLEMENT_CONFIG']]);
|
||||
$config->setConfig($settlement_data, '分销结算配置', $is_use, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', 'shop' ], [ 'config_key', '=', 'FENXIAO_SETTLEMENT_CONFIG' ] ]);
|
||||
//分销商提现配置
|
||||
$withdraw_data = [
|
||||
'withdraw' => $data['withdraw'],//最低提现额度
|
||||
'withdraw_rate' => $data['withdraw_rate'],//佣金提现手续费
|
||||
'withdraw' => $data[ 'withdraw' ],//最低提现额度
|
||||
'withdraw_rate' => $data[ 'withdraw_rate' ],//佣金提现手续费
|
||||
// 'min_no_fee' => $data['min_no_fee'],//最低免手续费区间
|
||||
// 'max_no_fee' => $data['max_no_fee'],//最高免手续费区间
|
||||
'withdraw_status' => $data['withdraw_status'],//提现审核
|
||||
'settlement_day' => $data['settlement_day'],//天数
|
||||
'withdraw_type' => $data['withdraw_type'],//提现方式
|
||||
'withdraw_status' => $data[ 'withdraw_status' ],//提现审核
|
||||
'settlement_day' => $data[ 'settlement_day' ],//天数
|
||||
'withdraw_type' => $data[ 'withdraw_type' ],//账户类型 alipay 支付宝 bank 银行卡
|
||||
|
||||
|
||||
'transfer_type' => $data['transfer_type'],//提现方式
|
||||
'max' => $data['max'],//提现方式
|
||||
'is_auto_transfer' => $data['is_auto_transfer'],//提现方式
|
||||
'transfer_type' => $data[ 'transfer_type' ],//提现方式
|
||||
'max' => $data[ 'max' ],//提现方式
|
||||
'is_auto_transfer' => $data[ 'is_auto_transfer' ], // 是否自动转账 1 手动转账 2 自动转账
|
||||
];
|
||||
|
||||
|
||||
$res = $config->setConfig($withdraw_data, '分销提现配置', $is_use, [['site_id', '=', $site_id], ['app_module', '=', 'shop'], ['config_key', '=', 'FENXIAO_WITHDRAW_CONFIG']]);
|
||||
$res = $config->setConfig($withdraw_data, '分销提现配置', $is_use, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', 'shop' ], [ 'config_key', '=', 'FENXIAO_WITHDRAW_CONFIG' ] ]);
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
|
@ -232,9 +217,9 @@ class Config extends BaseModel
|
|||
public function getFenxiaoSettlementConfig($site_id)
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', 'shop'], ['config_key', '=', 'FENXIAO_SETTLEMENT_CONFIG']]);
|
||||
if (empty($res['data']['value'])) {
|
||||
$res['data']['value'] = [
|
||||
$res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', 'shop' ], [ 'config_key', '=', 'FENXIAO_SETTLEMENT_CONFIG' ] ]);
|
||||
if (empty($res[ 'data' ][ 'value' ])) {
|
||||
$res[ 'data' ][ 'value' ] = [
|
||||
'account_type' => 0
|
||||
];
|
||||
}
|
||||
|
|
@ -248,31 +233,31 @@ class Config extends BaseModel
|
|||
public function getFenxiaoWithdrawConfig($site_id)
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', 'shop'], ['config_key', '=', 'FENXIAO_WITHDRAW_CONFIG']]);
|
||||
if (empty($res['data']['value'])) {
|
||||
$res['data']['value'] = [
|
||||
'withdraw' => 0,//最低提现额度
|
||||
'withdraw_rate' => 0,//佣金提现手续费
|
||||
'min_no_fee' => 0,//最低免手续费区间
|
||||
'max_no_fee' => 0,//最高免手续费区间
|
||||
$res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', 'shop' ], [ 'config_key', '=', 'FENXIAO_WITHDRAW_CONFIG' ] ]);
|
||||
if (empty($res[ 'data' ][ 'value' ])) {
|
||||
$res[ 'data' ][ 'value' ] = [
|
||||
'withdraw' => 0,//最低提现额度
|
||||
'withdraw_rate' => 0,//佣金提现手续费
|
||||
'min_no_fee' => 0,//最低免手续费区间
|
||||
'max_no_fee' => 0,//最高免手续费区间
|
||||
'withdraw_status' => 1,//提现审核
|
||||
'withdraw_type' => 0,//提现方式
|
||||
'withdraw_type' => 0,//提现方式
|
||||
'is_auto_transfer' => 0,
|
||||
'transfer_type' => '',
|
||||
'max' => 0
|
||||
];
|
||||
}
|
||||
$value = $res['data']['value'];
|
||||
if(!isset($value['transfer_type'])){
|
||||
$value['transfer_type'] = 'balance';
|
||||
$value = $res[ 'data' ][ 'value' ];
|
||||
if (!isset($value[ 'transfer_type' ])) {
|
||||
$value[ 'transfer_type' ] = 'balance';
|
||||
}
|
||||
if(!isset($value['max'])){
|
||||
$value['max'] = 0;
|
||||
if (!isset($value[ 'max' ])) {
|
||||
$value[ 'max' ] = 0;
|
||||
}
|
||||
if(!isset($value['is_auto_transfer'])){
|
||||
$value['is_auto_transfer'] = 0;
|
||||
if (!isset($value[ 'is_auto_transfer' ])) {
|
||||
$value[ 'is_auto_transfer' ] = 0;
|
||||
}
|
||||
$res['data']['value'] = $value;
|
||||
$res[ 'data' ][ 'value' ] = $value;
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
|
@ -281,14 +266,14 @@ class Config extends BaseModel
|
|||
*/
|
||||
public function getTransferType($site_id = 0, $app_module = 'shop')
|
||||
{
|
||||
$fenxiao_withdraw_model = new FenxiaoWithdraw();
|
||||
$fenxiao_withdraw_model = new FenxiaoWithdraw();
|
||||
$transfer_type_list = $fenxiao_withdraw_model->getTransferType($site_id);
|
||||
$config = $this->getFenxiaoWithdrawConfig($site_id)["data"]['value'] ?? [];
|
||||
$data = [];
|
||||
$support_type = explode(",", $config["transfer_type"]);
|
||||
$config = $this->getFenxiaoWithdrawConfig($site_id)[ "data" ][ 'value' ] ?? [];
|
||||
$data = [];
|
||||
$support_type = explode(",", $config[ "transfer_type" ]);
|
||||
foreach ($transfer_type_list as $k => $v) {
|
||||
if (in_array($k, $support_type)) {
|
||||
$data[$k] = $v;
|
||||
$data[ $k ] = $v;
|
||||
}
|
||||
}
|
||||
return $data;
|
||||
|
|
@ -304,7 +289,7 @@ class Config extends BaseModel
|
|||
public function setFenxiaoWordsConfig($data, $is_use, $site_id)
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->setConfig($data, '分销文字配置', $is_use, [['site_id', '=', $site_id], ['app_module', '=', 'shop'], ['config_key', '=', 'FENXIAO_WORDS_CONFIG']]);
|
||||
$res = $config->setConfig($data, '分销文字配置', $is_use, [ [ 'site_id', '=', $site_id ], [ 'app_module', '=', 'shop' ], [ 'config_key', '=', 'FENXIAO_WORDS_CONFIG' ] ]);
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
|
@ -315,15 +300,15 @@ class Config extends BaseModel
|
|||
public function getFenxiaoWordsConfig($site_id)
|
||||
{
|
||||
$config = new ConfigModel();
|
||||
$res = $config->getConfig([['site_id', '=', $site_id], ['app_module', '=', 'shop'], ['config_key', '=', 'FENXIAO_WORDS_CONFIG']]);
|
||||
if (empty($res['data']['value'])) {
|
||||
$res['data']['value'] = [
|
||||
'concept' => '分销',// 分销概念
|
||||
$res = $config->getConfig([ [ 'site_id', '=', $site_id ], [ 'app_module', '=', 'shop' ], [ 'config_key', '=', 'FENXIAO_WORDS_CONFIG' ] ]);
|
||||
if (empty($res[ 'data' ][ 'value' ])) {
|
||||
$res[ 'data' ][ 'value' ] = [
|
||||
'concept' => '分销',// 分销概念
|
||||
'fenxiao_name' => '分销商',// 分销商名称
|
||||
'withdraw' => '提现',// 提现名称
|
||||
'account' => '佣金',// 佣金
|
||||
'my_team' => '团队',// 我的团队
|
||||
'child' => '下线',// 下线
|
||||
'withdraw' => '提现',// 提现名称
|
||||
'account' => '佣金',// 佣金
|
||||
'my_team' => '团队',// 我的团队
|
||||
'child' => '下线',// 下线
|
||||
];
|
||||
}
|
||||
return $res;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
|
@ -15,7 +15,6 @@ use app\model\BaseModel;
|
|||
use app\model\member\Member;
|
||||
use app\model\order\OrderCommon;
|
||||
use app\model\system\Stat;
|
||||
use think\facade\Db;
|
||||
|
||||
/**
|
||||
* 分销
|
||||
|
|
@ -54,9 +53,11 @@ class Fenxiao extends BaseModel
|
|||
//获取上上级分销商id
|
||||
$grand_parent_id = model('fenxiao')->getInfo([ [ 'fenxiao_id', '=', $data[ 'parent' ] ], [ 'is_delete', '=', 0 ] ], 'parent');
|
||||
|
||||
if (!empty($grand_parent_id) || $grand_parent_id[ 'parent' ] != 0) {
|
||||
if (!empty($grand_parent_id) && $grand_parent_id[ 'parent' ] != 0) {
|
||||
//添加上上级分销商二级下线人数
|
||||
model('fenxiao')->setInc([ [ 'fenxiao_id', '=', $grand_parent_id[ 'parent' ] ] ], 'two_child_fenxiao_num');
|
||||
|
||||
$data[ 'grand_parent' ] = $grand_parent_id[ 'parent' ];
|
||||
}
|
||||
|
||||
// 分销商检测升级
|
||||
|
|
@ -70,13 +71,6 @@ 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) {
|
||||
|
|
@ -141,7 +135,7 @@ class Fenxiao extends BaseModel
|
|||
{
|
||||
$condition[] = [ 'f.is_delete', '=', 0 ];
|
||||
|
||||
$field = 'f.*,pf.fenxiao_name as parent_name,pf.level_id as parent_level_id,nm.username,nm.nickname,nm.headimg,nm.order_num,nm.order_money,fl.level_num';
|
||||
$field = 'f.*,pf.fenxiao_name as parent_name,nm.username,nm.nickname,nm.headimg,nm.order_num,nm.order_money,fl.level_num';
|
||||
$alias = 'f';
|
||||
$join = [
|
||||
[
|
||||
|
|
@ -208,7 +202,7 @@ class Fenxiao extends BaseModel
|
|||
if (!empty($list[ 'list' ])) {
|
||||
foreach ($list[ 'list' ] as $k => $v) {
|
||||
$team_num = $this->getFenxiaoTeamNum($v[ 'fenxiao_id' ], $v[ 'site_id' ]);
|
||||
$list[ 'list' ][ $k ][ 'team_num' ] = $team_num[ 'data' ]['num'];
|
||||
$list[ 'list' ][ $k ][ 'team_num' ] = $team_num[ 'data' ][ 'num' ];
|
||||
// if (empty($v['username'])) $list['list'][$k]['username'] = '--';
|
||||
// if (empty($v['nickname'])) $list['list'][$k]['nickname'] = '--';
|
||||
// if (empty($v['member_mobile'])) $list['list'][$k]['member_mobile'] = '--';
|
||||
|
|
@ -234,39 +228,33 @@ class Fenxiao extends BaseModel
|
|||
|
||||
/**
|
||||
* 获取分销商团队
|
||||
* @param int $level
|
||||
* @param int $fenxiao_id
|
||||
* @param number $page
|
||||
* @param string $page_size
|
||||
* @param $level
|
||||
* @param $fenxiao_id
|
||||
* @param int $page
|
||||
* @param int $page_size
|
||||
* @param int $is_pay
|
||||
* @return array
|
||||
*/
|
||||
public function getFenxiaoTeam($level, $fenxiao_id, $page = 1, $page_size = PAGE_LIST_ROWS, $is_pay = 0)
|
||||
{
|
||||
// 分销商内购
|
||||
$basics_config = (new Config())->getFenxiaoBasicsConfig(request()->siteid())['data']['value'];
|
||||
$self_purchase_rebate = $basics_config['self_purchase_rebate'];
|
||||
$fenxiao_level = $basics_config['level'];
|
||||
|
||||
$condition = '';
|
||||
$prefix = config("database")[ "connections" ][ "mysql" ][ "prefix" ];
|
||||
|
||||
// 下级分销商id集合
|
||||
$one_level_fenxiao = model('fenxiao')->getColumn([ ['parent', '=', $fenxiao_id] ], 'fenxiao_id');
|
||||
$one_level_fenxiao = model('fenxiao')->getColumn([ [ 'parent', '=', $fenxiao_id ] ], 'fenxiao_id');
|
||||
|
||||
switch ( $level ) {
|
||||
case 0:
|
||||
$or = empty($one_level_fenxiao) || ($fenxiao_level == 1 && $self_purchase_rebate) ? '' : " OR (f.parent = {$fenxiao_id}) ";
|
||||
$condition = "( (m.fenxiao_id = {$fenxiao_id} AND m.is_fenxiao = 0) ". $or .") AND m.is_delete = 0";
|
||||
break;
|
||||
// 一级分销
|
||||
case 1:
|
||||
// 直属会员 + 直属下级分销商
|
||||
$or = " OR (f.parent = {$fenxiao_id}) ";
|
||||
$condition = "( (m.fenxiao_id = {$fenxiao_id} AND m.is_fenxiao = 0) " . $or . ") AND m.is_delete = 0";
|
||||
break;
|
||||
// 二级分销
|
||||
case 2:
|
||||
// 直属下级分销商的下级分销商 + 直属下级分销商的会员
|
||||
if (!empty($one_level_fenxiao)) {
|
||||
// 是否开启分销商内购
|
||||
if ($self_purchase_rebate) {
|
||||
$condition = "m.is_fenxiao = 0 AND m.fenxiao_id in (". implode($one_level_fenxiao) .") AND m.is_delete = 0";
|
||||
} else {
|
||||
$two_level_fenxiao = model('fenxiao')->getColumn([ ['parent', '=', $fenxiao_id] ], 'fenxiao_id');
|
||||
$or = empty($two_level_fenxiao) ? '' : " OR (f.grand_parent = {$fenxiao_id}) ";
|
||||
$condition = "( (m.is_fenxiao = 0 AND m.fenxiao_id in (". implode($one_level_fenxiao) .") )". $or .") AND m.is_delete = 0";
|
||||
}
|
||||
$or = " OR (f.parent in (" . implode($one_level_fenxiao) . ") ) ";
|
||||
$condition = "( (m.is_fenxiao = 0 AND m.fenxiao_id in (" . implode(',', $one_level_fenxiao) . ") )" . $or . ") AND m.is_delete = 0";
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -285,7 +273,7 @@ class Fenxiao extends BaseModel
|
|||
$join = [
|
||||
[ 'fenxiao f', 'm.member_id = f.member_id', 'left' ]
|
||||
];
|
||||
$list = model('member')->pageList($condition, $field, '', $page, $page_size, $alias, $join);
|
||||
$list = model('member')->pageList($condition, $field, 'm.bind_fenxiao_time desc', $page, $page_size, $alias, $join);
|
||||
return $this->success($list);
|
||||
}
|
||||
|
||||
|
|
@ -300,40 +288,35 @@ class Fenxiao extends BaseModel
|
|||
$config_model = new Config();
|
||||
$fenxiao_basic_config = $config_model->getFenxiaoBasicsConfig($site_id)[ 'data' ][ 'value' ];
|
||||
$level = $fenxiao_basic_config[ 'level' ];
|
||||
$self_purchase_rebate = $fenxiao_basic_config['self_purchase_rebate'];
|
||||
|
||||
$prefix = config("database")[ "connections" ][ "mysql" ][ "prefix" ];
|
||||
|
||||
$num = model('member')->getCount([ [ 'fenxiao_id', '=', $fenxiao_id ], [ 'is_fenxiao', '=', 0 ], [ 'is_delete', '=', 0 ] ]);
|
||||
|
||||
// 下级分销商id集合
|
||||
$one_level_fenxiao = model('fenxiao')->getColumn([ ['parent', '=', $fenxiao_id],['is_delete', '=', 0] ], 'fenxiao_id');
|
||||
$one_level_fenxiao = model('fenxiao')->getColumn([ [ 'parent', '=', $fenxiao_id ], [ 'is_delete', '=', 0 ] ], 'fenxiao_id');
|
||||
|
||||
$return = [
|
||||
'member_num' => $num,
|
||||
'num' => $num,
|
||||
'fenxiao_num' => 0
|
||||
'num' => $num, // 总人数
|
||||
'member_num' => $num, // 会员人数
|
||||
'fenxiao_num' => 0 // 分销商人数
|
||||
];
|
||||
|
||||
switch ( $level ) {
|
||||
case 1:
|
||||
if (!$self_purchase_rebate) {
|
||||
$return['num'] += count($one_level_fenxiao);
|
||||
$return['fenxiao_num'] += count($one_level_fenxiao);
|
||||
}
|
||||
$return[ 'num' ] += count($one_level_fenxiao);
|
||||
$return[ 'fenxiao_num' ] += count($one_level_fenxiao);
|
||||
break;
|
||||
case 2:
|
||||
if (!empty($one_level_fenxiao)) {
|
||||
$return['num'] += count($one_level_fenxiao);
|
||||
$return['fenxiao_num'] += count($one_level_fenxiao);
|
||||
$return[ 'num' ] += count($one_level_fenxiao);
|
||||
$return[ 'fenxiao_num' ] += count($one_level_fenxiao);
|
||||
|
||||
$num = model('member')->getCount([ [ 'fenxiao_id', 'in', $one_level_fenxiao ], [ 'is_fenxiao', '=', 0 ], [ 'is_delete', '=', 0 ] ]);
|
||||
$return['num'] += $num;
|
||||
$return['member_num'] += $num;
|
||||
if (!$self_purchase_rebate) {
|
||||
$num = model('fenxiao')->getCount([ ['grand_parent', '=', $fenxiao_id],['is_delete', '=', 0] ], 'fenxiao_id');
|
||||
$return['num'] += $num;
|
||||
$return['fenxiao_num'] += $num;
|
||||
}
|
||||
$return[ 'num' ] += $num;
|
||||
$return[ 'member_num' ] += $num;
|
||||
|
||||
$num = model('fenxiao')->getCount([ [ 'parent', 'in', $one_level_fenxiao ], [ 'is_delete', '=', 0 ] ], 'fenxiao_id');
|
||||
$return[ 'num' ] += $num;
|
||||
$return[ 'fenxiao_num' ] += $num;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
@ -349,8 +332,9 @@ class Fenxiao extends BaseModel
|
|||
//如果有推荐人则要修改分享关系
|
||||
$member_model = new Member();
|
||||
$member_info = $member_model->getMemberInfo([ [ 'member_id', '=', $member_id ] ], 'source_member')[ 'data' ];
|
||||
if (!empty($member_info[ 'source_member' ])) $member_model->alterShareRelation($member_id, $member_info[ 'source_member' ], $site_id);
|
||||
// 自动成为分销商
|
||||
if (!empty($member_info[ 'source_member' ])) {
|
||||
$member_model->alterShareRelation($member_id, $member_info[ 'source_member' ], $site_id);
|
||||
}
|
||||
$this->autoBecomeFenxiao($member_id, $site_id);
|
||||
}
|
||||
|
||||
|
|
@ -360,9 +344,11 @@ class Fenxiao extends BaseModel
|
|||
*/
|
||||
public function autoBecomeFenxiao($member_id, $site_id)
|
||||
{
|
||||
$member_info = model('member')->getInfo([ ['member_id', '=', $member_id], ['site_id', '=', $site_id], ['is_delete', '=', 0] ], 'order_num,order_complete_num,order_money,order_complete_money,is_fenxiao');
|
||||
$member_info = model('member')->getInfo([ [ 'member_id', '=', $member_id ], [ 'site_id', '=', $site_id ], [ 'is_delete', '=', 0 ] ], 'order_num,order_complete_num,order_money,order_complete_money,is_fenxiao');
|
||||
if (empty($member_info)) return $this->error('', '未查询到会员信息');
|
||||
if ($member_info['is_fenxiao']) return $this->error('', '已经是分销商');
|
||||
|
||||
$fenxiao_info = $this->getFenxiaoDetailInfo([ [ 'f.member_id', '=', $member_id ] ])[ 'data' ];
|
||||
if (!empty($fenxiao_info) && $member_info[ 'is_fenxiao' ]) return $this->error('', '已经是分销商');
|
||||
|
||||
try {
|
||||
$config = new Config();
|
||||
|
|
@ -377,29 +363,29 @@ class Fenxiao extends BaseModel
|
|||
$fenxiao_config = $config->getFenxiaoConfig($site_id);
|
||||
$fenxiao_config = $fenxiao_config[ 'data' ][ 'value' ];
|
||||
|
||||
switch ($fenxiao_config[ 'fenxiao_condition' ]) {
|
||||
switch ( $fenxiao_config[ 'fenxiao_condition' ] ) {
|
||||
case 2:
|
||||
// 消费次数
|
||||
if ($fenxiao_config['consume_condition'] == 1 && $member_info['order_num'] < $fenxiao_config['consume_count']) return $this->error('', '未满足成为分销商的条件');
|
||||
if ($fenxiao_config['consume_condition'] == 2 && $member_info['order_complete_num'] < $fenxiao_config['consume_count']) return $this->error('', '未满足成为分销商的条件');
|
||||
if ($fenxiao_config[ 'consume_condition' ] == 1 && $member_info[ 'order_num' ] < $fenxiao_config[ 'consume_count' ]) return $this->error('', '未满足成为分销商的条件');
|
||||
if ($fenxiao_config[ 'consume_condition' ] == 2 && $member_info[ 'order_complete_num' ] < $fenxiao_config[ 'consume_count' ]) return $this->error('', '未满足成为分销商的条件');
|
||||
break;
|
||||
case 3:
|
||||
// 消费金额
|
||||
if ($fenxiao_config['consume_condition'] == 1 && bccomp($member_info['order_money'], $fenxiao_config['consume_money'], 2) == -1) return $this->error('', '未满足成为分销商的条件');
|
||||
if ($fenxiao_config['consume_condition'] == 2 && bccomp($member_info['order_complete_money'], $fenxiao_config['consume_money'], 2) == -1) return $this->error('', '未满足成为分销商的条件');
|
||||
if ($fenxiao_config[ 'consume_condition' ] == 1 && bccomp($member_info[ 'order_money' ], $fenxiao_config[ 'consume_money' ], 2) == -1) return $this->error('', '未满足成为分销商的条件');
|
||||
if ($fenxiao_config[ 'consume_condition' ] == 2 && bccomp($member_info[ 'order_complete_money' ], $fenxiao_config[ 'consume_money' ], 2) == -1) return $this->error('', '未满足成为分销商的条件');
|
||||
break;
|
||||
case 4:
|
||||
// 购买指定商品
|
||||
$condition = [
|
||||
['goods_id', 'in', $fenxiao_config['goods_ids'] ],
|
||||
[ 'goods_id', 'in', $fenxiao_config[ 'goods_ids' ] ],
|
||||
];
|
||||
if ($fenxiao_config['consume_condition'] == 1) $condition[] = ['pay_status', '=', 1];
|
||||
if ($fenxiao_config['consume_condition'] == 2) $condition[] = ['order_status', '=', OrderCommon::ORDER_COMPLETE];
|
||||
$count = model('order_goods')->getCount($condition, 'order_goods_id', 'og', [ ['order o', 'o.order_id = og.order_id', 'inner'] ]);
|
||||
if ($fenxiao_config[ 'consume_condition' ] == 1) $condition[] = [ 'pay_status', '=', 1 ];
|
||||
if ($fenxiao_config[ 'consume_condition' ] == 2) $condition[] = [ 'order_status', '=', OrderCommon::ORDER_COMPLETE ];
|
||||
$count = model('order_goods')->getCount($condition, 'order_goods_id', 'og', [ [ 'order o', 'o.order_id = og.order_id', 'inner' ] ]);
|
||||
if (!$count) return $this->error('', '未满足成为分销商的条件');
|
||||
break;
|
||||
}
|
||||
return $this->directlyBecomeFenxiao($member_id, $basics_config);
|
||||
return $this->directlyBecomeFenxiao($member_id);
|
||||
} catch (\Exception $e) {
|
||||
return $this->error();
|
||||
}
|
||||
|
|
@ -408,7 +394,7 @@ class Fenxiao extends BaseModel
|
|||
/**
|
||||
* 会员直接成为分销商
|
||||
*/
|
||||
private function directlyBecomeFenxiao($member_id, $config = [])
|
||||
private function directlyBecomeFenxiao($member_id)
|
||||
{
|
||||
//获取用户信息
|
||||
$member_field = 'member_id,site_id,source_member,fenxiao_id,nickname,headimg,mobile,reg_time,order_money,order_complete_money,order_num,order_complete_num';
|
||||
|
|
@ -434,7 +420,6 @@ class Fenxiao extends BaseModel
|
|||
'level_name' => $level_info[ 'data' ][ 'level_name' ]
|
||||
];
|
||||
$res = $this->addFenxiao($data);
|
||||
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
|
|
@ -519,7 +504,7 @@ class Fenxiao extends BaseModel
|
|||
$upgrade_level = $item;
|
||||
break;
|
||||
}
|
||||
} else if ($item[ 'upgrade_type' ] == 1) {
|
||||
} else {
|
||||
if (( $fenxiao_info[ 'order_num' ] >= $item[ 'order_num' ] && $item[ 'order_num' ] > 0 ) || ( $fenxiao_info[ 'order_money' ] >= $item[ 'order_money' ] && $item[ 'order_money' ] > 0 ) || ( $fenxiao_info[ 'one_fenxiao_order_num' ] >= $item[ 'one_fenxiao_order_num' ] && $item[ 'one_fenxiao_order_num' ] > 0 ) || ( $fenxiao_info[ 'one_fenxiao_order_money' ] >= $item[ 'one_fenxiao_order_money' ] && $item[ 'one_fenxiao_order_money' ] > 0 ) || ( $fenxiao_info[ 'one_fenxiao_total_order' ] >= $item[ 'one_fenxiao_total_order' ] && $item[ 'one_fenxiao_total_order' ] > 0 ) || ( $fenxiao_info[ 'one_child_num' ] >= $item[ 'one_child_num' ] && $item[ 'one_child_num' ] > 0 ) || ( $fenxiao_info[ 'one_child_fenxiao_num' ] >= $item[ 'one_child_fenxiao_num' ] && $item[ 'one_child_fenxiao_num' ] > 0 )) {
|
||||
$upgrade_level = $item;
|
||||
break;
|
||||
|
|
@ -590,10 +575,7 @@ class Fenxiao extends BaseModel
|
|||
|
||||
if ($member_info[ 'is_fenxiao' ] == 1) {//是分销商
|
||||
|
||||
$fenxiao_info = model('fenxiao')->getInfo(
|
||||
[ [ 'fenxiao_id', '=', $member_info[ 'fenxiao_id' ] ], [ 'is_delete', '=', 0 ] ],
|
||||
'parent'
|
||||
);
|
||||
$fenxiao_info = model('fenxiao')->getInfo([ [ 'fenxiao_id', '=', $member_info[ 'fenxiao_id' ] ], [ 'is_delete', '=', 0 ] ], 'parent');
|
||||
//修改原有上级分销商团队人数
|
||||
if ($fenxiao_info[ 'parent' ] > 0) {
|
||||
//获取原有上级分销商信息
|
||||
|
|
@ -603,7 +585,7 @@ class Fenxiao extends BaseModel
|
|||
//修改变更后的上级分销商团队人数
|
||||
model('fenxiao')->setInc([ [ 'fenxiao_id', '=', $parent ] ], 'one_child_fenxiao_num');
|
||||
//修改上级分销商
|
||||
model('fenxiao')->update([ 'parent' => $parent ], [ [ 'fenxiao_id', '=', $member_info[ 'fenxiao_id' ] ] ]);
|
||||
model('fenxiao')->update([ 'parent' => $parent, 'grand_parent' => $parent_info[ 'parent' ] ], [ [ 'fenxiao_id', '=', $member_info[ 'fenxiao_id' ] ] ]);
|
||||
} else {//不是分销商
|
||||
|
||||
//修改上级分销商
|
||||
|
|
@ -750,7 +732,7 @@ class Fenxiao extends BaseModel
|
|||
public function getFenxiaoRanking($site_id, $fenxiao_id, $order)
|
||||
{
|
||||
$prefix = config('database.connections.mysql.prefix');
|
||||
$version = model('fenxiao')->query('SELECT VERSION() as version')[0]['version'];
|
||||
$version = model('fenxiao')->query('SELECT VERSION() as version')[ 0 ][ 'version' ];
|
||||
|
||||
if (substr($version, 0, 1) == 8) {
|
||||
$query = "SELECT * FROM (select *,row_number() OVER(order by {$order} DESC) as rownum from {$prefix}fenxiao nf) AS f WHERE f.fenxiao_id = {$fenxiao_id}";
|
||||
|
|
@ -758,7 +740,7 @@ class Fenxiao extends BaseModel
|
|||
$query = "SELECT b.rownum FROM (SELECT t.*, @rownum := @rownum + 1 AS rownum FROM (SELECT @rownum := 0) r,(SELECT * FROM {$prefix}fenxiao WHERE site_id = {$site_id} ORDER BY {$order} DESC,fenxiao_id ASC) AS t) AS b WHERE b.fenxiao_id = {$fenxiao_id};";
|
||||
}
|
||||
$data = model('fenxiao')->query($query);
|
||||
$data = empty($data) ? 0 : $data[0]['rownum'];
|
||||
$data = empty($data) ? 0 : $data[ 0 ][ 'rownum' ];
|
||||
return $this->success($data);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
|
@ -20,11 +20,7 @@ class FenxiaoAccount extends BaseModel
|
|||
{
|
||||
public $type = [
|
||||
'withdraw' => '提现',
|
||||
'order' => '订单结算',
|
||||
'points' => '积分',
|
||||
'contribution' => '贡献值',
|
||||
'house_purchase' => '购房券',
|
||||
'diamond'=>'钻石'
|
||||
'order' => '订单结算',
|
||||
];
|
||||
|
||||
/**
|
||||
|
|
@ -36,23 +32,22 @@ class FenxiaoAccount extends BaseModel
|
|||
* @param $relate_id
|
||||
* @return array
|
||||
*/
|
||||
public function addAccount($fenxiao_id, $fenxiao_name, $type = 'diamond', $money, $relate_id, $from_type = 'diamond',$remarks='')
|
||||
public function addAccount($fenxiao_id, $fenxiao_name, $type, $money, $relate_id)
|
||||
{
|
||||
$account_no = date('YmdHi') . rand(1000, 9999);
|
||||
$data = array(
|
||||
'fenxiao_id' => $fenxiao_id,
|
||||
$data = array (
|
||||
'fenxiao_id' => $fenxiao_id,
|
||||
'fenxiao_name' => $fenxiao_name,
|
||||
'account_no' => $account_no,
|
||||
'money' => $money,
|
||||
'type' => $type,
|
||||
'type_name' => $this->type[$type],
|
||||
'relate_id' => $relate_id,
|
||||
'create_time' => time(),
|
||||
'remarks' => $remarks,
|
||||
'account_no' => $account_no,
|
||||
'money' => $money,
|
||||
'type' => $type,
|
||||
'type_name' => $this->type[ $type ],
|
||||
'relate_id' => $relate_id,
|
||||
'create_time' => time(),
|
||||
);
|
||||
|
||||
$res = model('fenxiao_account')->add($data);
|
||||
model('fenxiao')->setInc([['fenxiao_id', '=', $fenxiao_id]], $from_type, $money);
|
||||
model('fenxiao')->setInc([ [ 'fenxiao_id', '=', $fenxiao_id ] ], 'account', $money);
|
||||
|
||||
return $this->success($res);
|
||||
}
|
||||
|
|
@ -77,9 +72,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 = '*',$alias = 'a',$join = [])
|
||||
public function getFenxiaoAccountPageList($condition = [], $page = 1, $page_size = PAGE_LIST_ROWS, $order = 'create_time desc', $field = '*')
|
||||
{
|
||||
$list = model('fenxiao_account')->pageList($condition, $field, $order, $page, $page_size,$alias,$join);
|
||||
$list = model('fenxiao_account')->pageList($condition, $field, $order, $page, $page_size);
|
||||
return $this->success($list);
|
||||
}
|
||||
|
||||
|
|
@ -92,19 +87,18 @@ class FenxiaoAccount extends BaseModel
|
|||
* @param $relate_id
|
||||
* @return array
|
||||
*/
|
||||
public function addAccountLog($fenxiao_id, $fenxiao_name, $type = 'order', $money, $relate_id,$remarks='')
|
||||
public function addAccountLog($fenxiao_id, $fenxiao_name, $type, $money, $relate_id)
|
||||
{
|
||||
$account_no = date('YmdHi') . rand(1000, 9999);
|
||||
$data = array(
|
||||
'fenxiao_id' => $fenxiao_id,
|
||||
$data = array (
|
||||
'fenxiao_id' => $fenxiao_id,
|
||||
'fenxiao_name' => $fenxiao_name,
|
||||
'account_no' => $account_no,
|
||||
'money' => $money,
|
||||
'type' => $type,
|
||||
'type_name' => $this->type[$type],
|
||||
'relate_id' => $relate_id,
|
||||
'create_time' => time(),
|
||||
'remarks' => $remarks,
|
||||
'account_no' => $account_no,
|
||||
'money' => $money,
|
||||
'type' => $type,
|
||||
'type_name' => $this->type[ $type ],
|
||||
'relate_id' => $relate_id,
|
||||
'create_time' => time(),
|
||||
);
|
||||
$res = model('fenxiao_account')->add($data);
|
||||
return $this->success($res);
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
|
@ -12,7 +12,7 @@ namespace addon\fenxiao\model;
|
|||
|
||||
use app\model\BaseModel;
|
||||
use app\model\member\Member;
|
||||
use think\facade\Db;
|
||||
|
||||
|
||||
/**
|
||||
* 分销
|
||||
|
|
@ -21,8 +21,8 @@ class FenxiaoApply extends BaseModel
|
|||
{
|
||||
|
||||
public $fenxiao_status_zh = [
|
||||
1 => '待审核',
|
||||
2 => '已审核',
|
||||
1 => '待审核',
|
||||
2 => '已审核',
|
||||
-1 => '拒绝',
|
||||
];
|
||||
|
||||
|
|
@ -33,7 +33,7 @@ class FenxiaoApply extends BaseModel
|
|||
*/
|
||||
public function existFenxiaoName($fenxiao_name, $site_id)
|
||||
{
|
||||
$res = model('fenxiao_apply')->getCount([['fenxiao_name', '=', $fenxiao_name], ['site_id', '=', $site_id]]);
|
||||
$res = model('fenxiao_apply')->getCount([ [ 'fenxiao_name', '=', $fenxiao_name ], [ 'site_id', '=', $site_id ] ]);
|
||||
if ($res > 0) {
|
||||
return $this->error('', '该分销商名称已存在');
|
||||
}
|
||||
|
|
@ -47,49 +47,44 @@ class FenxiaoApply extends BaseModel
|
|||
* @param $mobile
|
||||
* @return array
|
||||
*/
|
||||
public function applyFenxiao($member_id, $site_id, $fenxiao_name = '', $mobile = '')
|
||||
public function applyFenxiao($member_id, $site_id, $fenxiao_name = '', $mobile = '',$id_card='',$id_card_front='',$id_card_reverse='')
|
||||
{
|
||||
//判断该用户是否已经申请
|
||||
$apply_info = model('fenxiao_apply')->getInfo([['member_id', '=', $member_id]], 'apply_id,status');
|
||||
if (!empty($apply_info) && $apply_info['status'] != -1) {
|
||||
$apply_info = model('fenxiao_apply')->getInfo([ [ 'member_id', '=', $member_id ] ], 'apply_id,status');
|
||||
if (!empty($apply_info) && $apply_info[ 'status' ] != -1) {
|
||||
return $this->error('', '已经申请过,请不要重复申请');
|
||||
}
|
||||
|
||||
// 分销商基础设置
|
||||
$config = new Config();
|
||||
$config = new Config();
|
||||
$basics_config = $config->getFenxiaoBasicsConfig($site_id);
|
||||
$basics_config = $basics_config['data']['value'];
|
||||
|
||||
$basics_config = $basics_config[ 'data' ][ 'value' ];
|
||||
if (!$basics_config[ 'level' ]) return $this->error('', '未开启分销');
|
||||
|
||||
//获取分销配置信息
|
||||
$fenxiao_config = $config->getFenxiaoConfig($site_id);
|
||||
$fenxiao_config = $fenxiao_config['data']['value'];
|
||||
|
||||
$fenxiao_config = $fenxiao_config[ 'data' ][ 'value' ];
|
||||
//获取用户信息
|
||||
$member_model = new Member();
|
||||
$member_field = 'source_member,fenxiao_id,nickname,headimg,reg_time,order_money,order_complete_money,order_num,order_complete_num';
|
||||
$member_info = $member_model->getMemberInfo([['member_id', '=', $member_id]], $member_field);
|
||||
|
||||
$member_info = $member_model->getMemberInfo([ [ 'member_id', '=', $member_id ] ], $member_field);
|
||||
// 判断用户是否可以成为申请分销商
|
||||
if ($fenxiao_config['fenxiao_condition'] == 2) {
|
||||
if ($fenxiao_config['consume_condition'] == 1 && $fenxiao_config['consume_count'] > $member_info['data']['order_num']) {
|
||||
if ($fenxiao_config[ 'fenxiao_condition' ] == 2) {
|
||||
if ($fenxiao_config[ 'consume_condition' ] == 1 && $fenxiao_config[ 'consume_count' ] > $member_info[ 'data' ][ 'order_num' ]) {
|
||||
return $this->error('', '您的消费次数未满足申请条件');
|
||||
} elseif ($fenxiao_config['consume_condition'] == 2 && $fenxiao_config['consume_count'] > $member_info['data']['order_complete_num']) {
|
||||
} elseif ($fenxiao_config[ 'consume_condition' ] == 2 && $fenxiao_config[ 'consume_count' ] > $member_info[ 'data' ][ 'order_complete_num' ]) {
|
||||
return $this->error('', '您的消费次数未满足申请条件');
|
||||
}
|
||||
} elseif ($fenxiao_config['fenxiao_condition'] == 3) {
|
||||
if ($fenxiao_config['consume_condition'] == 1 && $fenxiao_config['consume_money'] > $member_info['data']['order_money']) {
|
||||
} elseif ($fenxiao_config[ 'fenxiao_condition' ] == 3) {
|
||||
if ($fenxiao_config[ 'consume_condition' ] == 1 && $fenxiao_config[ 'consume_money' ] > $member_info[ 'data' ][ 'order_money' ]) {
|
||||
return $this->error('', '您的消费金额未满足申请条件');
|
||||
} elseif ($fenxiao_config['consume_condition'] == 2 && $fenxiao_config['consume_money'] > $member_info['data']['order_complete_money']) {
|
||||
} elseif ($fenxiao_config[ 'consume_condition' ] == 2 && $fenxiao_config[ 'consume_money' ] > $member_info[ 'data' ][ 'order_complete_money' ]) {
|
||||
return $this->error('', '您的消费金额未满足申请条件');
|
||||
}
|
||||
} elseif ($fenxiao_config['fenxiao_condition'] == 4){ //购买指定商品
|
||||
} elseif ($fenxiao_config[ 'fenxiao_condition' ] == 4) { //购买指定商品
|
||||
//获取用户购买商品是否在成为分销商指定商品区域
|
||||
$alias = 'og';
|
||||
$condition[] = ['og.member_id','=',$member_id];
|
||||
$condition[] = ['og.site_id','=',$site_id];
|
||||
$condition[] = ['og.goods_id','in',$fenxiao_config['goods_ids']];
|
||||
$condition[] = [ 'og.member_id', '=', $member_id ];
|
||||
$condition[] = [ 'og.site_id', '=', $site_id ];
|
||||
$condition[] = [ 'og.goods_id', 'in', $fenxiao_config[ 'goods_ids' ] ];
|
||||
$field = 'o.order_status,og.goods_id';
|
||||
$join = [
|
||||
[
|
||||
|
|
@ -99,64 +94,63 @@ class FenxiaoApply extends BaseModel
|
|||
],
|
||||
|
||||
];
|
||||
if($fenxiao_config['consume_condition'] == 1){
|
||||
$condition[] = ['o.order_status','in',['1','2','3','4','10']];
|
||||
$order_data = model('order_goods')->getList($condition,$field,'',$alias,$join);
|
||||
if(empty($order_data)){
|
||||
if ($fenxiao_config[ 'consume_condition' ] == 1) {
|
||||
$condition[] = [ 'o.order_status', 'in', [ '1', '2', '3', '4', '10' ] ];
|
||||
$order_data = model('order_goods')->getList($condition, $field, '', $alias, $join);
|
||||
if (empty($order_data)) {
|
||||
return $this->error('', '您还未满足申请条件');
|
||||
}
|
||||
} elseif ($fenxiao_config['consume_condition'] == 2){
|
||||
$condition[] = ['o.order_status','=','10'];
|
||||
$order_data = model('order_goods')->getList($condition,$field,'',$alias,$join);
|
||||
if(empty($order_data)){
|
||||
} elseif ($fenxiao_config[ 'consume_condition' ] == 2) {
|
||||
$condition[] = [ 'o.order_status', '=', '10' ];
|
||||
$order_data = model('order_goods')->getList($condition, $field, '', $alias, $join);
|
||||
if (empty($order_data)) {
|
||||
return $this->error('', '您还未满足申请条件');
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (empty($fenxiao_name)) $fenxiao_name = $member_info['data']['nickname'];
|
||||
|
||||
if (empty($fenxiao_name)) $fenxiao_name = $member_info[ 'data' ][ 'nickname' ];
|
||||
//获取分销等级信息
|
||||
$level_model = new FenxiaoLevel();
|
||||
$level_info = $level_model->getLevelInfo([['site_id', '=', $site_id], ['is_default', '=', 1]], 'level_id,level_name');
|
||||
|
||||
$level_info = $level_model->getLevelInfo([ [ 'site_id', '=', $site_id ], [ 'is_default', '=', 1 ] ], 'level_id,level_name');
|
||||
// 成为分销商是否需要审核
|
||||
if ($basics_config['is_examine']) {
|
||||
if ($basics_config[ 'is_examine' ]) {
|
||||
$apply_data = [
|
||||
'site_id' => $site_id,
|
||||
'fenxiao_name' => $fenxiao_name,
|
||||
'parent' => $member_info['data']['fenxiao_id'],
|
||||
'member_id' => $member_id,
|
||||
'mobile' => $mobile,
|
||||
'nickname' => $member_info['data']['nickname'],
|
||||
'headimg' => $member_info['data']['headimg'],
|
||||
'level_id' => $level_info['data']['level_id'],
|
||||
'level_name' => $level_info['data']['level_name'],
|
||||
'order_complete_money' => $member_info['data']['order_complete_money'],
|
||||
'order_complete_num' => $member_info['data']['order_complete_num'],
|
||||
'reg_time' => $member_info['data']['reg_time'],
|
||||
'create_time' => time(),
|
||||
'status' => 1
|
||||
'site_id' => $site_id,
|
||||
'fenxiao_name' => $fenxiao_name,
|
||||
'parent' => $member_info[ 'data' ][ 'fenxiao_id' ],
|
||||
'member_id' => $member_id,
|
||||
'mobile' => $mobile,
|
||||
'nickname' => $member_info[ 'data' ][ 'nickname' ],
|
||||
'headimg' => $member_info[ 'data' ][ 'headimg' ],
|
||||
'level_id' => $level_info[ 'data' ][ 'level_id' ],
|
||||
'level_name' => $level_info[ 'data' ][ 'level_name' ],
|
||||
'order_complete_money' => $member_info[ 'data' ][ 'order_complete_money' ],
|
||||
'order_complete_num' => $member_info[ 'data' ][ 'order_complete_num' ],
|
||||
'reg_time' => $member_info[ 'data' ][ 'reg_time' ],
|
||||
'id_card' => $id_card,
|
||||
'id_card_front' => $id_card_front,
|
||||
'id_card_reverse' => $id_card_reverse,
|
||||
'create_time' => time(),
|
||||
'status' => 1
|
||||
];
|
||||
if (!empty($apply_info)) {
|
||||
$res = model('fenxiao_apply')->update($apply_data, [['member_id', '=', $member_id]]);
|
||||
$res = model('fenxiao_apply')->update($apply_data, [ [ 'member_id', '=', $member_id ] ]);
|
||||
} else {
|
||||
$res = model('fenxiao_apply')->add($apply_data);
|
||||
}
|
||||
return $this->success($res);
|
||||
} else {
|
||||
$fenxiao_data = [
|
||||
'site_id' => $site_id,
|
||||
$fenxiao_data = [
|
||||
'site_id' => $site_id,
|
||||
'fenxiao_name' => $fenxiao_name,
|
||||
'mobile' => $mobile,
|
||||
'member_id' => $member_id,
|
||||
'parent' => $member_info['data']['fenxiao_id'],
|
||||
'level_id' => $level_info['data']['level_id'],
|
||||
'level_name' => $level_info['data']['level_name']
|
||||
'mobile' => $mobile,
|
||||
'member_id' => $member_id,
|
||||
'parent' => $member_info[ 'data' ][ 'fenxiao_id' ],
|
||||
'level_id' => $level_info[ 'data' ][ 'level_id' ],
|
||||
'level_name' => $level_info[ 'data' ][ 'level_name' ]
|
||||
];
|
||||
$fenxiao_model = new Fenxiao();
|
||||
$res = $fenxiao_model->addFenxiao($fenxiao_data);
|
||||
$res = $fenxiao_model->addFenxiao($fenxiao_data);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
|
|
@ -167,39 +161,39 @@ class FenxiaoApply extends BaseModel
|
|||
public function addFenxiao($fenxiao_data)
|
||||
{
|
||||
|
||||
if (empty($fenxiao_data['fenxiao_name'])) {
|
||||
if (empty($fenxiao_data[ 'fenxiao_name' ])) {
|
||||
return $this->error('', '分销商名称不能为空');
|
||||
}
|
||||
if (empty($fenxiao_data['level_id'])) {
|
||||
if (empty($fenxiao_data[ 'level_id' ])) {
|
||||
return $this->error('', '请选择分销商等级');
|
||||
}
|
||||
if (empty($fenxiao_data['member_id'])) {
|
||||
if (empty($fenxiao_data[ 'member_id' ])) {
|
||||
return $this->error('', '请选择关联会员');
|
||||
}
|
||||
|
||||
//判断该用户是否已经申请
|
||||
$apply_info = model('fenxiao_apply')->getInfo([['member_id', '=', $fenxiao_data['member_id']]], 'apply_id,status');
|
||||
if (!empty($apply_info) && $apply_info['status'] != -1) {
|
||||
$apply_info = model('fenxiao_apply')->getInfo([ [ 'member_id', '=', $fenxiao_data[ 'member_id' ] ] ], 'apply_id,status');
|
||||
if (!empty($apply_info) && $apply_info[ 'status' ] != -1) {
|
||||
return $this->error('', '已经申请过,请不要重复申请');
|
||||
}
|
||||
|
||||
// 分销商基础设置
|
||||
$config = new Config();
|
||||
$config = new Config();
|
||||
|
||||
//获取分销配置信息
|
||||
$fenxiao_config = $config->getFenxiaoConfig($fenxiao_data['site_id']);
|
||||
$fenxiao_config = $fenxiao_config['data']['value'];
|
||||
$fenxiao_config = $config->getFenxiaoConfig($fenxiao_data[ 'site_id' ]);
|
||||
$fenxiao_config = $fenxiao_config[ 'data' ][ 'value' ];
|
||||
|
||||
//获取用户信息
|
||||
$member_model = new Member();
|
||||
$member_field = 'source_member,fenxiao_id,nickname,headimg,reg_time,order_money,order_complete_money,order_num,order_complete_num';
|
||||
$member_info = $member_model->getMemberInfo([['member_id', '=', $fenxiao_data['member_id']]], $member_field);
|
||||
$member_info = $member_model->getMemberInfo([ [ 'member_id', '=', $fenxiao_data[ 'member_id' ] ] ], $member_field);
|
||||
if (empty($member_info)) return $this->error('', '未获取到会员信息');
|
||||
|
||||
//获取分销等级信息
|
||||
$level_model = new FenxiaoLevel();
|
||||
$level_info = $level_model->getLevelInfo([['site_id', '=', $fenxiao_data['site_id']], ['level_id', '=', $fenxiao_data['level_id']]], 'level_name');
|
||||
$fenxiao_data['level_name'] = $level_info['data']['level_name'];
|
||||
$level_info = $level_model->getLevelInfo([ [ 'site_id', '=', $fenxiao_data[ 'site_id' ] ], [ 'level_id', '=', $fenxiao_data[ 'level_id' ] ] ], 'level_name');
|
||||
$fenxiao_data[ 'level_name' ] = $level_info[ 'data' ][ 'level_name' ];
|
||||
|
||||
$fenxiao_model = new Fenxiao();
|
||||
return $fenxiao_model->addFenxiao($fenxiao_data);
|
||||
|
|
@ -213,32 +207,32 @@ class FenxiaoApply extends BaseModel
|
|||
*/
|
||||
public function pass($apply_id, $site_id)
|
||||
{
|
||||
$info = model('fenxiao_apply')->getInfo([['apply_id', '=', $apply_id], ['site_id', '=', $site_id]]);
|
||||
if ($info['status'] == 2) {
|
||||
$info = model('fenxiao_apply')->getInfo([ [ 'apply_id', '=', $apply_id ], [ 'site_id', '=', $site_id ] ]);
|
||||
if ($info[ 'status' ] == 2) {
|
||||
return $this->success();
|
||||
}
|
||||
|
||||
model('fenxiao_apply')->startTrans();
|
||||
try {
|
||||
$data = [
|
||||
'status' => 2,
|
||||
'status' => 2,
|
||||
'update_time' => time(),
|
||||
];
|
||||
$res = model('fenxiao_apply')->update($data, [['apply_id', '=', $apply_id], ['site_id', '=', $site_id]]);
|
||||
$res = model('fenxiao_apply')->update($data, [ [ 'apply_id', '=', $apply_id ], [ 'site_id', '=', $site_id ] ]);
|
||||
|
||||
$fenxiao_data = [
|
||||
'site_id' => $info['site_id'],
|
||||
'fenxiao_name' => $info['fenxiao_name'],
|
||||
'mobile' => $info['mobile'],
|
||||
'member_id' => $info['member_id'],
|
||||
'parent' => $info['parent'],
|
||||
'level_id' => $info['level_id'],
|
||||
'level_name' => $info['level_name']
|
||||
'site_id' => $info[ 'site_id' ],
|
||||
'fenxiao_name' => $info[ 'fenxiao_name' ],
|
||||
'mobile' => $info[ 'mobile' ],
|
||||
'member_id' => $info[ 'member_id' ],
|
||||
'parent' => $info[ 'parent' ],
|
||||
'level_id' => $info[ 'level_id' ],
|
||||
'level_name' => $info[ 'level_name' ]
|
||||
];
|
||||
|
||||
$fenxiao_model = new Fenxiao();
|
||||
$result = $fenxiao_model->addFenxiao($fenxiao_data);
|
||||
if ($result['code'] != 0) {
|
||||
$result = $fenxiao_model->addFenxiao($fenxiao_data);
|
||||
if ($result[ 'code' ] != 0) {
|
||||
model('fenxiao_apply')->rollback();
|
||||
return $result;
|
||||
}
|
||||
|
|
@ -261,11 +255,11 @@ class FenxiaoApply extends BaseModel
|
|||
public function refuse($apply_id)
|
||||
{
|
||||
$data = [
|
||||
'status' => -1,
|
||||
'status' => -1,
|
||||
'update_time' => time()
|
||||
];
|
||||
|
||||
$res = model('fenxiao_apply')->update($data, [['apply_id', '=', $apply_id]]);
|
||||
$res = model('fenxiao_apply')->update($data, [ [ 'apply_id', '=', $apply_id ] ]);
|
||||
return $this->success($res);
|
||||
}
|
||||
|
||||
|
|
@ -306,124 +300,4 @@ class FenxiaoApply extends BaseModel
|
|||
return $this->success($count);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Common: 获取代理申请
|
||||
* Author: wu-hui
|
||||
* Time: 2023/02/27 10:18
|
||||
* @param array $condition
|
||||
* @param string $field
|
||||
* @return array
|
||||
*/
|
||||
public function getFenXiaoUpgradeApplyInfo($condition = [], $field = '*'){
|
||||
$res = model('fenxiao_apply_upgrade')->getInfo($condition, $field);
|
||||
return $this->success($res);
|
||||
}
|
||||
/**
|
||||
* Common: 分销商申请升级
|
||||
* Author: wu-hui
|
||||
* Time: 2023/02/27 10:26
|
||||
* @param $params
|
||||
* @return array
|
||||
*/
|
||||
public function upgradeApply($params){
|
||||
// 判断: 协议是否一致
|
||||
$config = (new Config())->getFenxiaoBasicsConfig($params['site_id'])['data'];
|
||||
$upgradeAgree = $config['value']['upgrade_agree'] ?? '';
|
||||
if($params['upgrade_agree'] !== $upgradeAgree) return $this->error('','协议不一致,请检查输入内容是否和协议内容一直');
|
||||
// 判断:当前用户是否为分销商
|
||||
$fenXiaoInfo = (new Fenxiao())->getFenxiaoInfo([['member_id','=',$params['member_id']]])['data'];
|
||||
if(!$fenXiaoInfo) return $this->error('','请先成为分销商!');
|
||||
// 判断:如果存在审核中申请 禁止提交
|
||||
$upgradeInfo = $this->getFenXiaoUpgradeApplyInfo([['member_id','=',$params['member_id']]])['data'];
|
||||
if($upgradeInfo && $upgradeInfo['status'] == 1) return $this->error('','申请审核中,请勿重复提交!');
|
||||
// 添加协议
|
||||
$data = [
|
||||
'username' => $params['username'],
|
||||
'phone' => $params['phone'],
|
||||
'id_card' => $params['id_card'],
|
||||
'id_card_front' => $params['id_card_front'],
|
||||
'id_card_reverse' => $params['id_card_reverse'],
|
||||
'update_time' => time(),
|
||||
'status' => 1,
|
||||
];
|
||||
if($upgradeInfo){
|
||||
// 修改
|
||||
model('fenxiao_apply_upgrade')->update($data, [['member_id','=',$params['member_id']]]);
|
||||
}else{
|
||||
// 添加
|
||||
$data['site_id'] = $params['site_id'];
|
||||
$data['fenxiao_id'] = $fenXiaoInfo['fenxiao_id'];
|
||||
$data['member_id'] = $params['member_id'];
|
||||
$data['create_time'] = time();
|
||||
$data['site_id'] = $params['site_id'];
|
||||
|
||||
model('fenxiao_apply_upgrade')->add($data);
|
||||
}
|
||||
|
||||
return $this->success();
|
||||
}
|
||||
/**
|
||||
* Common: 分销商申请升级列表
|
||||
* Author: wu-hui
|
||||
* Time: 2023/02/27 11:39
|
||||
* @param array $condition
|
||||
* @param int $page
|
||||
* @param int $page_size
|
||||
* @param string $order
|
||||
* @param string $field
|
||||
* @param string $alias
|
||||
* @param array $join
|
||||
* @return array
|
||||
*/
|
||||
public function getPageList($condition = [], $page = 1, $page_size = PAGE_LIST_ROWS, $order = '', $field = 'a.*', $alias = 'a', $join = []){
|
||||
$list = model('fenxiao_apply_upgrade')->pageList($condition, $field, $order, $page, $page_size, $alias, $join);
|
||||
return $this->success($list);
|
||||
}
|
||||
/**
|
||||
* Common: 代理申请 审核
|
||||
* Author: wu-hui
|
||||
* Time: 2023/02/27 14:28
|
||||
* @return array
|
||||
* @throws \think\db\exception\DataNotFoundException
|
||||
* @throws \think\db\exception\DbException
|
||||
* @throws \think\db\exception\ModelNotFoundException
|
||||
*/
|
||||
public function upgradeApplyExamine(){
|
||||
//参数获取
|
||||
$id = input('id');
|
||||
$type = input('type');
|
||||
$cause = input('cause','');
|
||||
// 根据审核类型生成修改数据
|
||||
$update['update_time'] = time();
|
||||
if($type === 'pass') {
|
||||
$update['status'] = 2;
|
||||
// 审核通过
|
||||
$fenXiaoId = (int)Db::name('fenxiao_apply_upgrade')->where('id',$id)->value('fenxiao_id');
|
||||
if($fenXiaoId <= 0) return $this->error('','分销商不存在!');
|
||||
$currentLevelId = (int)Db::name('fenxiao')->where('fenxiao_id',$fenXiaoId)->value('level_id');
|
||||
// 升级:按照权重顺序升级 加一查询下一级内容 如果存在则升级成功,否则升级失败
|
||||
$currentNum = (int)Db::name('fenxiao_level')->where('level_id',$currentLevelId)->value('level_num');
|
||||
$currentNum++;
|
||||
$next = Db::name('fenxiao_level')
|
||||
->field('level_id,level_name')
|
||||
->where('level_num',$currentNum)
|
||||
->find();
|
||||
// 修改分销商等级
|
||||
model('fenxiao')->update([
|
||||
'level_id' => $next['level_id'],
|
||||
'level_name' => $next['level_name']
|
||||
],[['fenxiao_id','=',$fenXiaoId]]);
|
||||
}
|
||||
else if($type === 'reject'){
|
||||
// 审核不通过
|
||||
$update['status'] = 3;
|
||||
$update['reject_cause'] = $cause;
|
||||
}
|
||||
model('fenxiao_apply_upgrade')->update($update, [['id','=',$id]]);
|
||||
|
||||
return $this->success();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
|
@ -26,17 +26,17 @@ class FenxiaoData extends BaseModel
|
|||
public function getFenxiaoAccountData($site_id)
|
||||
{
|
||||
$field = 'sum(account) as account,sum(account_withdraw) as account_withdraw,sum(account_withdraw_apply) as account_withdraw_apply';
|
||||
$res = model('fenxiao')->getInfo([['status', 'in', '1,-1'], ['site_id', '=', $site_id],['is_delete','=',0]], $field);
|
||||
$res = model('fenxiao')->getInfo([ [ 'status', 'in', '1,-1' ], [ 'site_id', '=', $site_id ], [ 'is_delete', '=', 0 ] ], $field);
|
||||
|
||||
if (empty($res) || $res['account'] == null) {
|
||||
$res['account'] = '0.00';
|
||||
if (empty($res) || $res[ 'account' ] == null) {
|
||||
$res[ 'account' ] = '0.00';
|
||||
}
|
||||
|
||||
if (empty($res) || $res['account_withdraw'] == null) {
|
||||
$res['account_withdraw'] = '0.00';
|
||||
if (empty($res) || $res[ 'account_withdraw' ] == null) {
|
||||
$res[ 'account_withdraw' ] = '0.00';
|
||||
}
|
||||
if (empty($res) || $res['account_withdraw_apply'] == null) {
|
||||
$res['account_withdraw_apply'] = '0.00';
|
||||
if (empty($res) || $res[ 'account_withdraw_apply' ] == null) {
|
||||
$res[ 'account_withdraw_apply' ] = '0.00';
|
||||
}
|
||||
|
||||
return $res;
|
||||
|
|
@ -48,7 +48,7 @@ class FenxiaoData extends BaseModel
|
|||
*/
|
||||
public function getFenxiaoApplyCount($site_id)
|
||||
{
|
||||
$count = model('fenxiao_apply')->getCount([['status', '=', 1], ['site_id', '=', $site_id]]);
|
||||
$count = model('fenxiao_apply')->getCount([ [ 'status', '=', 1 ], [ 'site_id', '=', $site_id ] ]);
|
||||
return $count;
|
||||
}
|
||||
|
||||
|
|
@ -58,7 +58,7 @@ class FenxiaoData extends BaseModel
|
|||
*/
|
||||
public function getFenxiaoCount($site_id)
|
||||
{
|
||||
$count = model('fenxiao')->getCount([['site_id', '=', $site_id],['is_delete','=',0]]);
|
||||
$count = model('fenxiao')->getCount([ [ 'site_id', '=', $site_id ], [ 'is_delete', '=', 0 ] ]);
|
||||
return $count;
|
||||
}
|
||||
|
||||
|
|
@ -69,9 +69,9 @@ class FenxiaoData extends BaseModel
|
|||
public function getFenxiaoOrderSum($site_id)
|
||||
{
|
||||
$field = 'sum(real_goods_money) as real_goods_money';
|
||||
$res = model('fenxiao_order')->getInfo([['site_id', '=', $site_id]], $field);
|
||||
if ($res['real_goods_money'] == null) {
|
||||
$res['real_goods_money'] = '0.00';
|
||||
$res = model('fenxiao_order')->getInfo([ [ 'site_id', '=', $site_id ] ], $field);
|
||||
if ($res[ 'real_goods_money' ] == null) {
|
||||
$res[ 'real_goods_money' ] = '0.00';
|
||||
}
|
||||
return $res;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
|
@ -94,7 +94,7 @@ class FenxiaoGoodsSku extends BaseModel
|
|||
* @param string $order
|
||||
* @return array
|
||||
*/
|
||||
public function getFenxiaoGoodsSkuPageList($condition = [], $page = 1, $page_size = PAGE_LIST_ROWS, $order = 'g.create_time desc', $field = 'g.goods_id,g.label_name,g.goods_name,g.goods_image,g.sku_id,gs.sku_name,gs.discount_price,gs.price,gs.promotion_type,gs.is_free_shipping,gs.stock,gs.sale_num,gs.sku_image,gs.site_id,gs.fenxiao_price,g.fenxiao_type,(g.sale_num + g.virtual_sale) as sale_sort')
|
||||
public function getFenxiaoGoodsSkuPageList($condition = [], $page = 1, $page_size = PAGE_LIST_ROWS, $order = 'g.create_time desc', $field = 'g.goods_id,g.label_name,g.goods_name,g.goods_image,g.sku_id,gs.sku_name,gs.discount_price,gs.price,gs.stock,gs.sale_num,gs.sku_image,gs.fenxiao_price,g.fenxiao_type,(g.sale_num + g.virtual_sale) as sale_sort')
|
||||
{
|
||||
$alias = 'g';
|
||||
$join = [
|
||||
|
|
@ -133,7 +133,6 @@ class FenxiaoGoodsSku extends BaseModel
|
|||
public function getSkuFenxiaoCommission($sku_id, $level_id){
|
||||
$commission = 0.00;
|
||||
|
||||
$alias = 'fgs';
|
||||
$condition = [ [ 'gs.sku_id', '=', $sku_id ], [ 'g.is_fenxiao', '=', 1 ] ];
|
||||
$join = [
|
||||
['goods g','g.goods_id = gs.goods_id','inner']
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,68 +1,24 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\fenxiao\model;
|
||||
|
||||
use app\model\BaseModel;
|
||||
use app\model\member\MemberAccount;
|
||||
use app\model\message\Message;
|
||||
use app\model\system\Stat;
|
||||
use think\facade\Db;
|
||||
use think\facade\Log;
|
||||
|
||||
/**
|
||||
* 分销商品
|
||||
*/
|
||||
class FenxiaoOrder extends BaseModel
|
||||
{
|
||||
/***
|
||||
* 区域代理结算
|
||||
* 月结
|
||||
* @return array
|
||||
*/
|
||||
public function areaMonthlySettlement()
|
||||
{
|
||||
//本月
|
||||
$beginThismonth = mktime(0, 0, 0, date('m'), 1, date('Y'));
|
||||
$endThismonth = mktime(23, 59, 59, date('m'), date('t'), date('Y'));
|
||||
//上月
|
||||
$begin_time = strtotime(date('Y-m-01 00:00:00', strtotime('-1 month')));
|
||||
$end_time = strtotime(date("Y-m-d 23:59:59", strtotime(-date('d') . 'day')));
|
||||
$fenxiao = Db::name('fenxiao_agent')->alias('a')->join(
|
||||
'fenxiao f',
|
||||
'a.fenxiao_id = f.fenxiao_id',
|
||||
'left'
|
||||
)->where([['f.status','=',1]])->column('f.fenxiao_id,f.site_id,member_id,fenxiao_name,agent_level_id,province_id,city_id,district_id,parent', 'f.fenxiao_id');
|
||||
//获取分销基础配置
|
||||
$config_model = new Config();
|
||||
$fenxiao_basic_config = $config_model->getFenxiaoBasicsConfig(1);
|
||||
$fenxiao_member_account = new MemberAccount();
|
||||
foreach ($fenxiao as $fenxiao_id => $item) {
|
||||
$fenxiao_agent_level = Db::name('fenxiao_agent_level')->where('level_id', '=', $item['agent_level_id'])->field('type,flower_multiple,status')->find();
|
||||
$where = [
|
||||
// ['fo.create_time', 'BETWEEN', [$begin_time, $end_time]],
|
||||
['fo.create_time', 'BETWEEN', [$beginThismonth, $endThismonth]],
|
||||
['o.'.$fenxiao_agent_level['type'].'_id', '=', $item[$fenxiao_agent_level['type'].'_id']]
|
||||
];
|
||||
$fenxia_area_order_info = Db::name('fenxiao_order')
|
||||
->alias('fo')
|
||||
->join('order o','fo.order_id=o.order_id','LEFT')
|
||||
->where($where)
|
||||
->field('sum(real_goods_money) as real_goods_money')
|
||||
->find();
|
||||
$money = $fenxia_area_order_info['real_goods_money'] * $fenxiao_agent_level['flower_multiple']/100;
|
||||
$fenxiao_member_account->addMemberAccount($item[ 'site_id' ], $item['member_id'], 'balance_money', $money, 'area', '区域代理结算', '区域代理结算');
|
||||
|
||||
}
|
||||
return $this->success();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分销订单计算
|
||||
|
|
@ -74,6 +30,9 @@ class FenxiaoOrder extends BaseModel
|
|||
$config_model = new Config();
|
||||
$fenxiao_basic_config = $config_model->getFenxiaoBasicsConfig($order[ 'site_id' ]);
|
||||
$level_config = $fenxiao_basic_config[ 'data' ][ 'value' ][ 'level' ];
|
||||
if($order['promotion_type']){
|
||||
return $this->success();
|
||||
}
|
||||
if (empty($level_config)) {
|
||||
return $this->success();
|
||||
}
|
||||
|
|
@ -92,6 +51,12 @@ class FenxiaoOrder extends BaseModel
|
|||
if (empty($fenxiao_info)) {
|
||||
return $this->success();
|
||||
}
|
||||
// 如果购买人是分销商 并且未开启分销商自购
|
||||
if ($member_info['is_fenxiao'] && $fenxiao_basic_config[ 'data' ][ 'value' ][ 'self_purchase_rebate' ] == 0) {
|
||||
if (empty($fenxiao_info['parent'])) return $this->success();
|
||||
$fenxiao_info = model("fenxiao")->getInfo([ [ 'fenxiao_id', '=', $fenxiao_info['parent'] ], [ 'is_delete', '=', 0 ] ]);
|
||||
if (empty($fenxiao_info)) return $this->success();
|
||||
}
|
||||
|
||||
//判断几级分销
|
||||
$parent_fenxiao_info = $level_config >= 2 ? model('fenxiao')->getInfo([ [ 'fenxiao_id', '=', $fenxiao_info[ 'parent' ] ], [ 'is_delete', '=', 0 ] ], 'fenxiao_id, fenxiao_name, status, parent') : [];
|
||||
|
|
@ -101,49 +66,34 @@ class FenxiaoOrder extends BaseModel
|
|||
|
||||
model('fenxiao_order')->delete([ [ 'order_id', '=', $order[ 'order_id' ] ] ]);
|
||||
//获取分销等级
|
||||
$order['give_diamond'] = 0;
|
||||
foreach ($order_goods as $k => $v) {
|
||||
//商品信息管理
|
||||
$goods_info = model("goods")->getInfo([ [ 'goods_id', '=', $v[ 'goods_id' ] ] ], 'is_fenxiao, fenxiao_type,give_diamond');
|
||||
$goods_info = model("goods")->getInfo([ [ 'goods_id', '=', $v[ 'goods_id' ] ] ], 'is_fenxiao, fenxiao_type');
|
||||
if ($goods_info[ 'is_fenxiao' ] != 1) {
|
||||
$order['give_diamond'] += $goods_info['give_diamond'];
|
||||
continue;
|
||||
}
|
||||
|
||||
$sku_info = model('goods_sku')->getInfo([ [ 'sku_id', '=', $v[ 'sku_id' ] ] ], 'fenxiao_price');
|
||||
if (!empty($sku_info) && $sku_info[ 'fenxiao_price' ] > 0) $v[ 'real_goods_money' ] = $sku_info[ 'fenxiao_price' ] * $v[ 'num' ];
|
||||
|
||||
$commission = 0;
|
||||
$commission_rate = 0;
|
||||
$order_fenxiao_data = [];
|
||||
|
||||
$order_fenxiao_data = [
|
||||
'one_rate' => 0,
|
||||
'one_commission' => 0,
|
||||
'two_rate' => 0,
|
||||
'two_commission' => 0,
|
||||
'three_rate' => 0,
|
||||
];
|
||||
if ($goods_info[ 'fenxiao_type' ] == 2) {
|
||||
// 自定义分销规则
|
||||
$fenxiao_level = model('fenxiao_goods_sku')->getInfo([ [ 'goods_id', '=', $v[ 'goods_id' ] ], [ 'sku_id', '=', $v[ 'sku_id' ] ], [ 'level_id', '=', $fenxiao_info[ 'level_id' ] ] ]);
|
||||
if (empty($fenxiao_level)) continue;
|
||||
|
||||
if ($fenxiao_info[ 'status' ] == 1) {
|
||||
if ($member_info[ 'is_fenxiao' ] == 1) {
|
||||
if ($fenxiao_basic_config[ 'data' ][ 'value' ][ 'self_purchase_rebate' ]) {
|
||||
if ($fenxiao_level[ 'one_rate' ] > 0) {
|
||||
$commission_rate += $order_fenxiao_data[ 'one_rate' ] = $fenxiao_level[ 'one_rate' ];
|
||||
$commission += $order_fenxiao_data[ 'one_commission' ] = $fenxiao_level[ 'one_rate' ] * $v[ 'real_goods_money' ] / 100;
|
||||
} else {
|
||||
$commission_rate += $order_fenxiao_data[ 'one_rate' ] = round($fenxiao_level[ 'one_money' ] * $v[ 'num' ] / $v[ 'real_goods_money' ], 2);
|
||||
$commission += $order_fenxiao_data[ 'one_commission' ] = $fenxiao_level[ 'one_money' ] * $v[ 'num' ];
|
||||
}
|
||||
} else {
|
||||
$order_fenxiao_data[ 'one_rate' ] = 0;
|
||||
$order_fenxiao_data[ 'one_commission' ] = 0;
|
||||
}
|
||||
if ($fenxiao_level[ 'one_rate' ] > 0) {
|
||||
$commission_rate += $order_fenxiao_data[ 'one_rate' ] = $fenxiao_level[ 'one_rate' ];
|
||||
$commission += $order_fenxiao_data[ 'one_commission' ] = $fenxiao_level[ 'one_rate' ] * $v[ 'real_goods_money' ] / 100;
|
||||
} else {
|
||||
if ($fenxiao_level[ 'one_rate' ] > 0) {
|
||||
$commission_rate += $order_fenxiao_data[ 'one_rate' ] = $fenxiao_level[ 'one_rate' ];
|
||||
$commission += $order_fenxiao_data[ 'one_commission' ] = $fenxiao_level[ 'one_rate' ] * $v[ 'real_goods_money' ] / 100;
|
||||
} else {
|
||||
$commission_rate += $order_fenxiao_data[ 'one_rate' ] = round($fenxiao_level[ 'one_money' ] * $v[ 'num' ] / $v[ 'real_goods_money' ], 2);
|
||||
$commission += $order_fenxiao_data[ 'one_commission' ] = $fenxiao_level[ 'one_money' ] * $v[ 'num' ];
|
||||
}
|
||||
$commission_rate += $order_fenxiao_data[ 'one_rate' ] = round($fenxiao_level[ 'one_money' ] * $v[ 'num' ] / $v[ 'real_goods_money' ], 2);
|
||||
$commission += $order_fenxiao_data[ 'one_commission' ] = $fenxiao_level[ 'one_money' ] * $v[ 'num' ];
|
||||
}
|
||||
}
|
||||
if (!empty($parent_fenxiao_info) && $parent_fenxiao_info[ 'status' ] == 1) {
|
||||
|
|
@ -168,27 +118,12 @@ class FenxiaoOrder extends BaseModel
|
|||
// 默认规则
|
||||
$fenxiao_level = model('fenxiao_level')->getInfo([ [ 'level_id', '=', $fenxiao_info[ 'level_id' ] ] ]);
|
||||
if ($fenxiao_info[ 'status' ] == 1) {
|
||||
if ($member_info[ 'is_fenxiao' ] == 1) {
|
||||
if ($fenxiao_basic_config[ 'data' ][ 'value' ][ 'self_purchase_rebate' ]) {
|
||||
if ($fenxiao_level[ 'one_rate' ] > 0) {
|
||||
$commission_rate += $order_fenxiao_data[ 'one_rate' ] = $fenxiao_level[ 'one_rate' ];
|
||||
$commission += $order_fenxiao_data[ 'one_commission' ] = $fenxiao_level[ 'one_rate' ] * $v[ 'real_goods_money' ] / 100;
|
||||
} else {
|
||||
$order_fenxiao_data[ 'one_rate' ] = 0;
|
||||
$order_fenxiao_data[ 'one_commission' ] = 0;
|
||||
}
|
||||
} else {
|
||||
$order_fenxiao_data[ 'one_rate' ] = 0;
|
||||
$order_fenxiao_data[ 'one_commission' ] = 0;
|
||||
}
|
||||
if ($fenxiao_level[ 'one_rate' ] > 0) {
|
||||
$commission_rate += $order_fenxiao_data[ 'one_rate' ] = $fenxiao_level[ 'one_rate' ];
|
||||
$commission += $order_fenxiao_data[ 'one_commission' ] = $fenxiao_level[ 'one_rate' ] * $v[ 'real_goods_money' ] / 100;
|
||||
} else {
|
||||
if ($fenxiao_level[ 'one_rate' ] > 0) {
|
||||
$commission_rate += $order_fenxiao_data[ 'one_rate' ] = $fenxiao_level[ 'one_rate' ];
|
||||
$commission += $order_fenxiao_data[ 'one_commission' ] = $fenxiao_level[ 'one_rate' ] * $v[ 'real_goods_money' ] / 100;
|
||||
} else {
|
||||
$order_fenxiao_data[ 'one_rate' ] = 0;
|
||||
$order_fenxiao_data[ 'one_commission' ] = 0;
|
||||
}
|
||||
$order_fenxiao_data[ 'one_rate' ] = 0;
|
||||
$order_fenxiao_data[ 'one_commission' ] = 0;
|
||||
}
|
||||
}
|
||||
if (!empty($parent_fenxiao_info) && $parent_fenxiao_info[ 'status' ] == 1) {
|
||||
|
|
@ -210,7 +145,6 @@ class FenxiaoOrder extends BaseModel
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
//启动分销
|
||||
$data = [
|
||||
'order_id' => $order[ 'order_id' ],
|
||||
|
|
@ -231,81 +165,27 @@ class FenxiaoOrder extends BaseModel
|
|||
'full_address' => $order[ 'full_address' ] . $order[ 'address' ],
|
||||
'commission' => $commission,
|
||||
'commission_rate' => $commission_rate,
|
||||
|
||||
'one_fenxiao_id' => empty($fenxiao_info) ? 0 : $fenxiao_info[ 'fenxiao_id' ],
|
||||
'one_rate' => empty($order_fenxiao_data[ 'one_rate' ]) ? 0 : $order_fenxiao_data[ 'one_rate' ],
|
||||
'one_commission' => empty($order_fenxiao_data[ 'one_commission' ]) ? 0 : $order_fenxiao_data[ 'one_commission' ],
|
||||
'one_fenxiao_name' => empty($fenxiao_info) ? '' : $fenxiao_info[ 'fenxiao_name' ],
|
||||
|
||||
'two_fenxiao_id' => empty($parent_fenxiao_info) ? 0 : $parent_fenxiao_info[ 'fenxiao_id' ],
|
||||
'two_rate' => empty($order_fenxiao_data[ 'two_rate' ]) ? 0 : $order_fenxiao_data[ 'two_rate' ],
|
||||
'two_commission' => empty($order_fenxiao_data[ 'two_commission' ]) ? 0 : $order_fenxiao_data[ 'two_commission' ],
|
||||
'two_fenxiao_name' => empty($parent_fenxiao_info) ? '' : $parent_fenxiao_info[ 'fenxiao_name' ],
|
||||
|
||||
'three_fenxiao_id' => empty($grand_parent_fenxiao_info) ? '' : $grand_parent_fenxiao_info[ 'fenxiao_id' ],
|
||||
'three_rate' => empty($order_fenxiao_data[ 'three_rate' ]) ? 0 : $order_fenxiao_data[ 'three_rate' ],
|
||||
'three_commission' => empty($order_fenxiao_data[ 'three_commission' ]) ? 0 : $order_fenxiao_data[ 'three_commission' ],
|
||||
'three_fenxiao_name' => empty($grand_parent_fenxiao_info) ? '' : $grand_parent_fenxiao_info[ 'fenxiao_name' ],
|
||||
'create_time' => time()
|
||||
];
|
||||
|
||||
model("fenxiao_order")->add($data);
|
||||
}
|
||||
if($order['promotion_type'] != 'futures'){
|
||||
$this->orderGive($order);
|
||||
}
|
||||
// 分销商检测升级
|
||||
event('FenxiaoUpgrade', $member_info[ 'fenxiao_id' ]);
|
||||
|
||||
return $this->success('Fenxiao');
|
||||
}
|
||||
|
||||
/***
|
||||
* 下单赠送
|
||||
* @param $order
|
||||
* @return array
|
||||
*/
|
||||
public function orderGive($order)
|
||||
{
|
||||
$id = model('fenxiao_account')->getValue([
|
||||
'type' => 'points',
|
||||
'relate_id' => $order['order_id'],
|
||||
], 'id');//验证下单重复赠送
|
||||
if (!$id) {
|
||||
$i_fenxiao = model('fenxiao')->getInfo(['member_id' => $order['member_id'], 'site_id' => $order['site_id']], 'fenxiao_id,fenxiao_name,parent,grand_parent');
|
||||
if ($i_fenxiao) {
|
||||
$fenxiao_account = new FenxiaoAccount;
|
||||
$fenxiao_account->addAccount($i_fenxiao['fenxiao_id'], $i_fenxiao['fenxiao_name'], 'diamond', $order['give_diamond'], $order['order_id'],'diamond', '商品下单赠送');
|
||||
}
|
||||
}
|
||||
return $this->success();
|
||||
}
|
||||
/**
|
||||
* 每日结算
|
||||
* @return array
|
||||
*/
|
||||
public function daySettlement(){
|
||||
$fenxiaoList = model('fenxiao')->getList([['status', '=', 1],['points', '>', 0]],'fenxiao_id,fenxiao_name,points,contribution,site_id,member_id');
|
||||
$config_model = new Config();
|
||||
$menber_account = new MemberAccount();
|
||||
$fenxiao_account = new FenxiaoAccount();
|
||||
foreach($fenxiaoList as $fenxiao){
|
||||
$basic_config = $config_model->getFenxiaoBasicsConfig($fenxiao['site_id'])['data']['value'];
|
||||
$point_ratio = $basic_config['settlement_points_to_point_ratio'] / 100;//0.5
|
||||
$balance_money_ratio = $basic_config['settlement_points_to_balance_money_ratio'] / 100;//0.5
|
||||
$points_ratio = $basic_config['no_contribution_points_ratio'] / 100;//0.0005
|
||||
if($fenxiao['contribution'] > 0){
|
||||
$points_ratio = $basic_config['contribution_points_ratio'] / 100;//0.001
|
||||
}
|
||||
$points = $fenxiao['points'] * $points_ratio;
|
||||
$point = $points * $point_ratio;
|
||||
$balance_money = $points * $balance_money_ratio;
|
||||
|
||||
$menber_account->addMemberAccount($fenxiao[ 'site_id' ], $fenxiao['member_id'], 'point', $point, 'day_settlement', '每日转换', '每日转换');
|
||||
$menber_account->addMemberAccount($fenxiao[ 'site_id' ], $fenxiao['member_id'], 'balance_money', $balance_money, 'day_settlement', '每日转换', '每日转换');
|
||||
|
||||
$fenxiao_account->addAccount($fenxiao['fenxiao_id'], $fenxiao['fenxiao_name'], 'points', -$points, 0,'points', '每日转换消耗');
|
||||
if($fenxiao['contribution'] > 0){
|
||||
$fenxiao_account->addAccount($fenxiao['fenxiao_id'],$fenxiao['fenxiao_name'],'contribution',-$points,0,'contribution','每日转换消耗');
|
||||
}
|
||||
}
|
||||
return $this->success();
|
||||
}
|
||||
|
||||
|
|
@ -314,18 +194,11 @@ class FenxiaoOrder extends BaseModel
|
|||
* @param $order_goods_id
|
||||
* @return array
|
||||
*/
|
||||
public function refund($order_goods)
|
||||
public function refund($order_goods_id)
|
||||
{
|
||||
$order_goods_info = model('order_goods')->getInfo([ 'order_goods_id' => $order_goods[ 'order_goods_id' ] ], 'refund_mode');
|
||||
$goode_info = model('goods')->getInfo([['goods_id', '=', $order_goods['goods_id']]]);
|
||||
|
||||
$order_goods_info = model('order_goods')->getInfo([ 'order_goods_id' => $order_goods_id ], 'refund_mode');
|
||||
if ($order_goods_info[ 'refund_mode' ] == 1) {
|
||||
$i_fenxiao = model('fenxiao')->getInfo(['member_id' => $order_goods['member_id']], 'fenxiao_id,fenxiao_name,parent,grand_parent');
|
||||
if ($i_fenxiao) {
|
||||
$fenxiao_account = new FenxiaoAccount;
|
||||
$fenxiao_account->addAccount($i_fenxiao['fenxiao_id'], $i_fenxiao['fenxiao_name'], 'diamond', -$goode_info['give_diamond'], $order_goods['order_id'],'diamond', '商品退款扣除');
|
||||
}
|
||||
$res = model("fenxiao_order")->update([ 'is_refund' => 1 ], [ [ 'order_goods_id', '=', $order_goods[ 'order_goods_id' ] ] ]);
|
||||
$res = model("fenxiao_order")->update([ 'is_refund' => 1 ], [ [ 'order_goods_id', '=', $order_goods_id ] ]);
|
||||
return $this->success($res);
|
||||
}
|
||||
}
|
||||
|
|
@ -349,7 +222,6 @@ class FenxiaoOrder extends BaseModel
|
|||
$site_id = $fenxiao_order[ 'site_id' ];
|
||||
$commission += $fenxiao_order[ 'one_commission' ];
|
||||
$fenxiao_account->addAccount($fenxiao_order[ 'one_fenxiao_id' ], $fenxiao_order[ 'one_fenxiao_name' ], 'order', $fenxiao_order[ 'one_commission' ], $fenxiao_order[ 'fenxiao_order_id' ]);
|
||||
|
||||
// 分销佣金发放通知
|
||||
( new Message() )->sendMessage([
|
||||
'keywords' => 'COMMISSION_GRANT',
|
||||
|
|
@ -357,13 +229,10 @@ class FenxiaoOrder extends BaseModel
|
|||
'site_id' => $fenxiao_order[ 'site_id' ],
|
||||
'level' => 'one',
|
||||
]);
|
||||
|
||||
model('fenxiao')->setInc([ [ 'fenxiao_id', '=', $fenxiao_order[ 'one_fenxiao_id' ] ] ], 'total_commission', $fenxiao_order[ 'one_commission' ]);
|
||||
|
||||
if ($fenxiao_order[ 'two_commission' ] > 0) {
|
||||
$commission += $fenxiao_order[ 'two_commission' ];
|
||||
$fenxiao_account->addAccount($fenxiao_order[ 'two_fenxiao_id' ], $fenxiao_order[ 'two_fenxiao_name' ], 'order', $fenxiao_order[ 'two_commission' ], $fenxiao_order[ 'fenxiao_order_id' ]);
|
||||
|
||||
// 分销佣金发放通知
|
||||
( new Message() )->sendMessage([
|
||||
'keywords' => 'COMMISSION_GRANT',
|
||||
|
|
@ -371,13 +240,11 @@ class FenxiaoOrder extends BaseModel
|
|||
'site_id' => $fenxiao_order[ 'site_id' ],
|
||||
'level' => 'two',
|
||||
]);
|
||||
|
||||
model('fenxiao')->setInc([ [ 'fenxiao_id', '=', $fenxiao_order[ 'two_fenxiao_id' ] ] ], 'total_commission', $fenxiao_order[ 'two_commission' ]);
|
||||
}
|
||||
if ($fenxiao_order[ 'three_commission' ] > 0) {
|
||||
$commission += $fenxiao_order[ 'three_commission' ];
|
||||
$fenxiao_account->addAccount($fenxiao_order[ 'three_fenxiao_id' ], $fenxiao_order[ 'three_fenxiao_name' ], 'order', $fenxiao_order[ 'three_commission' ], $fenxiao_order[ 'fenxiao_order_id' ]);
|
||||
|
||||
// 分销佣金发放通知
|
||||
( new Message() )->sendMessage([
|
||||
'keywords' => 'COMMISSION_GRANT',
|
||||
|
|
@ -385,10 +252,8 @@ class FenxiaoOrder extends BaseModel
|
|||
'site_id' => $fenxiao_order[ 'site_id' ],
|
||||
'level' => 'three',
|
||||
]);
|
||||
|
||||
model('fenxiao')->setInc([ [ 'fenxiao_id', '=', $fenxiao_order[ 'three_fenxiao_id' ] ] ], 'total_commission', $fenxiao_order[ 'three_commission' ]);
|
||||
}
|
||||
|
||||
}
|
||||
$stat_model = new Stat();
|
||||
$stat_model->switchStat([ 'type' => 'fenxiao_order', 'data' => [ 'order_id' => $order_id, 'site_id' => $site_id ] ]);
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
|
@ -36,18 +36,21 @@ class FenxiaoWithdraw extends BaseModel
|
|||
'bank' => '银行卡',
|
||||
];
|
||||
|
||||
public $status = array(
|
||||
public $status = array (
|
||||
1 => '待审核',
|
||||
2 => '待转账',
|
||||
3 => '已转账',
|
||||
-1 => '已拒绝'
|
||||
);
|
||||
public function getTransferType($site_id){
|
||||
$pay_model = new Pay();
|
||||
|
||||
public function getTransferType($site_id)
|
||||
{
|
||||
$pay_model = new Pay();
|
||||
$transfer_type_list = $pay_model->getTransferType($site_id);
|
||||
$transfer_type_list['balance'] = '余额';
|
||||
$transfer_type_list[ 'balance' ] = '余额';
|
||||
return $transfer_type_list;
|
||||
}
|
||||
|
||||
/**
|
||||
* 分销商申请提现
|
||||
* @param $data
|
||||
|
|
@ -143,7 +146,7 @@ class FenxiaoWithdraw extends BaseModel
|
|||
$withdraw_list = $this->getFenxiaoWithdrawList([ [ 'id', 'in', $ids ] ], '*');
|
||||
foreach ($withdraw_list[ 'data' ] as $k => $v) {
|
||||
if ($v[ 'status' ] == 1) {
|
||||
$this->agree(['id' => $v['id'], 'site_id' => $site_id]);
|
||||
$this->agree([ 'id' => $v[ 'id' ], 'site_id' => $site_id ]);
|
||||
}
|
||||
}
|
||||
model('fenxiao_withdraw')->commit();
|
||||
|
|
@ -172,29 +175,30 @@ class FenxiaoWithdraw extends BaseModel
|
|||
*/
|
||||
public function getFenxiaoWithdrawDetail($params)
|
||||
{
|
||||
$id = $params['id'];
|
||||
$site_id = $params['site_id'] ?? 0;
|
||||
$member_id = $params['member_id'] ?? 0;
|
||||
$condition = array(
|
||||
['id', '=', $id]
|
||||
$id = $params[ 'id' ];
|
||||
$site_id = $params[ 'site_id' ] ?? 0;
|
||||
$member_id = $params[ 'member_id' ] ?? 0;
|
||||
$condition = array (
|
||||
[ 'id', '=', $id ]
|
||||
);
|
||||
if($site_id > 0){
|
||||
$condition[] = ['site_id', '=', $site_id];
|
||||
if ($site_id > 0) {
|
||||
$condition[] = [ 'site_id', '=', $site_id ];
|
||||
}
|
||||
if($member_id > 0){
|
||||
$condition[] = ['member_id', '=', $member_id];
|
||||
if ($member_id > 0) {
|
||||
$condition[] = [ 'member_id', '=', $member_id ];
|
||||
}
|
||||
$info = model('fenxiao_withdraw')->getInfo($condition, '*');
|
||||
if(!empty($info)){
|
||||
if (!empty($info)) {
|
||||
$info = $this->tran($info);
|
||||
}
|
||||
return $this->success($info);
|
||||
}
|
||||
|
||||
public function tran($data){
|
||||
$status = $data['status'] ?? 0;
|
||||
if($status != 0){
|
||||
$data['status_name'] = $this->status[$status] ?? '';
|
||||
public function tran($data)
|
||||
{
|
||||
$status = $data[ 'status' ] ?? 0;
|
||||
if ($status != 0) {
|
||||
$data[ 'status_name' ] = $this->status[ $status ] ?? '';
|
||||
}
|
||||
return $data;
|
||||
}
|
||||
|
|
@ -457,101 +461,100 @@ class FenxiaoWithdraw extends BaseModel
|
|||
public function apply($data, $site_id = 0, $app_module = 'shop')
|
||||
{
|
||||
$config_model = new Config();
|
||||
$config = $config_model->getFenxiaoWithdrawConfig($site_id)['data']['value'] ?? [];
|
||||
$config = $config_model->getFenxiaoWithdrawConfig($site_id)[ 'data' ][ 'value' ] ?? [];
|
||||
|
||||
$withdraw_no = $this->createWithdrawNo();
|
||||
$apply_money = round($data['apply_money'], 2);
|
||||
$apply_money = round($data[ 'apply_money' ], 2);
|
||||
|
||||
$withdraw_min_money = $config['withdraw'];
|
||||
$withdraw_max_money = $config['max'];
|
||||
$withdraw_min_money = $config[ 'withdraw' ];
|
||||
$withdraw_max_money = $config[ 'max' ];
|
||||
if ($apply_money < $withdraw_min_money) return $this->error([], '申请提现金额不能小于最低提现额度' . $withdraw_min_money);
|
||||
if($apply_money > $withdraw_max_money) return $this->error([], '申请提现金额不能大于最高提现额度' . $withdraw_max_money);
|
||||
if ($apply_money > $withdraw_max_money) return $this->error([], '申请提现金额不能大于最高提现额度' . $withdraw_max_money);
|
||||
|
||||
$member_id = $data['member_id'];
|
||||
$member_model = new Member();
|
||||
$member_condition = array(
|
||||
['member_id', '=', $member_id]
|
||||
$member_id = $data[ 'member_id' ];
|
||||
$member_model = new Member();
|
||||
$member_condition = array (
|
||||
[ 'member_id', '=', $member_id ]
|
||||
);
|
||||
$member_info = $member_model->getMemberInfo($member_condition, 'balance_money,headimg,wx_openid,username,mobile,weapp_openid,nickname')['data'] ?? [];
|
||||
$member_info = $member_model->getMemberInfo($member_condition, 'balance_money,headimg,wx_openid,username,mobile,weapp_openid,nickname')[ 'data' ] ?? [];
|
||||
if (empty($member_info))
|
||||
return $this->error([], 'MEMBER_NOT_EXIST');
|
||||
|
||||
$fenxiao_model = new Fenxiao();
|
||||
$fenxiao_info = $fenxiao_model->getFenxiaoInfo($member_condition, 'fenxiao_id,fenxiao_name,account')['data'] ?? [];
|
||||
$fenxiao_info = $fenxiao_model->getFenxiaoInfo($member_condition, 'fenxiao_id,fenxiao_name,account')[ 'data' ] ?? [];
|
||||
if (empty($fenxiao_info)) {
|
||||
return $this->error('该分销商不存在');
|
||||
}
|
||||
$fenxiao_account = $fenxiao_info['account'];//会员的分销佣金
|
||||
$fenxiao_account = $fenxiao_info[ 'account' ];//会员的分销佣金
|
||||
if ($fenxiao_account < $apply_money) {
|
||||
return $this->error('', '提现金额大于可提现金额');
|
||||
}
|
||||
|
||||
$transfer_type = $data['transfer_type'];
|
||||
$transfer_type = $data[ 'transfer_type' ];
|
||||
$transfer_type_list = $this->getTransferType($site_id);
|
||||
$transfer_type_name = $transfer_type_list[$transfer_type] ?? '';
|
||||
$transfer_type_name = $transfer_type_list[ $transfer_type ] ?? '';
|
||||
if (empty($transfer_type_name))
|
||||
return $this->error([], '不支持的提现方式');
|
||||
|
||||
model('fenxiao_withdraw')->startTrans();
|
||||
try {
|
||||
$withdraw_rate = $config['withdraw_rate'];
|
||||
$bank_name = '';
|
||||
$withdraw_rate = $config[ 'withdraw_rate' ];
|
||||
$bank_name = '';
|
||||
$account_number = '';
|
||||
$applet_type = 0;
|
||||
switch ($transfer_type) {
|
||||
switch ( $transfer_type ) {
|
||||
case 'bank':
|
||||
$bank_name = $data['bank_name'];
|
||||
$account_number = $data['account_number'];
|
||||
|
||||
$bank_name = $data[ 'bank_name' ];
|
||||
$account_number = $data[ 'account_number' ];
|
||||
break;
|
||||
case 'alipay':
|
||||
$bank_name = '';
|
||||
$account_number = $data['account_number'];
|
||||
$bank_name = '';
|
||||
$account_number = $data[ 'account_number' ];
|
||||
break;
|
||||
case 'wechatpay':
|
||||
$bank_name = '';
|
||||
if(empty($member_info['wx_openid']) && empty($member_info['weapp_openid'])){
|
||||
return $this->error('','请绑定微信或更换提现账户');
|
||||
if (empty($member_info[ 'wx_openid' ]) && empty($member_info[ 'weapp_openid' ])) {
|
||||
return $this->error('', '请绑定微信或更换提现账户');
|
||||
}
|
||||
if(!empty($member_info['wx_openid'])){
|
||||
$account_number = $member_info['wx_openid'];
|
||||
if (!empty($member_info[ 'wx_openid' ])) {
|
||||
$account_number = $member_info[ 'wx_openid' ];
|
||||
$applet_type = 0; // 公众号
|
||||
} else {
|
||||
$account_number = $member_info['weapp_openid'];
|
||||
$account_number = $member_info[ 'weapp_openid' ];
|
||||
$applet_type = 1; // 小程序
|
||||
}
|
||||
break;
|
||||
|
||||
}
|
||||
if($transfer_type == 'balance'){
|
||||
if ($transfer_type == 'balance') {
|
||||
$withdraw_rate = 0;
|
||||
}
|
||||
$service_money = round($apply_money * $withdraw_rate / 100, 2);//手续费
|
||||
$real_money = $apply_money - $service_money;
|
||||
$data = array(
|
||||
'site_id' => $site_id,
|
||||
'withdraw_no' => $withdraw_no,
|
||||
'member_id' => $member_id,
|
||||
'fenxiao_id' => $fenxiao_info['fenxiao_id'],
|
||||
'fenxiao_name' => $fenxiao_info['fenxiao_name'],
|
||||
'transfer_type' => $transfer_type,
|
||||
$real_money = $apply_money - $service_money;
|
||||
$data = array (
|
||||
'site_id' => $site_id,
|
||||
'withdraw_no' => $withdraw_no,
|
||||
'member_id' => $member_id,
|
||||
'fenxiao_id' => $fenxiao_info[ 'fenxiao_id' ],
|
||||
'fenxiao_name' => $fenxiao_info[ 'fenxiao_name' ],
|
||||
'transfer_type' => $transfer_type,
|
||||
'transfer_name' => $transfer_type_name,
|
||||
'money' => $apply_money,
|
||||
'withdraw_rate_money' => $service_money,
|
||||
'withdraw_rate' => $withdraw_rate,
|
||||
'real_money' => $real_money,
|
||||
'create_time' => time(),
|
||||
'status' => 1,
|
||||
'money' => $apply_money,
|
||||
'withdraw_rate_money' => $service_money,
|
||||
'withdraw_rate' => $withdraw_rate,
|
||||
'real_money' => $real_money,
|
||||
'create_time' => time(),
|
||||
'status' => 1,
|
||||
|
||||
'member_headimg' => $member_info['headimg'],
|
||||
'realname' => $data['realname'],
|
||||
'bank_name' => $bank_name,
|
||||
'account_number' => $account_number,
|
||||
'mobile' => $data['mobile'],
|
||||
'applet_type' => $applet_type
|
||||
'member_headimg' => $member_info[ 'headimg' ],
|
||||
'realname' => $data[ 'realname' ],
|
||||
'bank_name' => $bank_name,
|
||||
'account_number' => $account_number,
|
||||
'mobile' => $data[ 'mobile' ],
|
||||
'applet_type' => $applet_type
|
||||
);
|
||||
|
||||
$result = model('fenxiao_withdraw')->add($data);
|
||||
$result = model('fenxiao_withdraw')->add($data);
|
||||
//修改分销商提现中金额
|
||||
model('fenxiao')->setInc($member_condition, 'account_withdraw_apply', $apply_money);
|
||||
//修改分销商可提现金额
|
||||
|
|
@ -565,7 +568,7 @@ class FenxiaoWithdraw extends BaseModel
|
|||
|
||||
//判断是否需要审核
|
||||
if ($config[ 'withdraw_status' ] == 2) {//不需要
|
||||
$result = $this->agree(['id' => $result, 'site_id' => $site_id]);
|
||||
$result = $this->agree([ 'id' => $result, 'site_id' => $site_id ]);
|
||||
if ($result[ 'code' ] < 0) {
|
||||
model('fenxiao_withdraw')->rollback();
|
||||
return $result;
|
||||
|
|
@ -598,15 +601,16 @@ class FenxiaoWithdraw extends BaseModel
|
|||
}
|
||||
|
||||
|
||||
public function agree($params){
|
||||
$id = $params['id'];
|
||||
$site_id = $params['site_id'];
|
||||
public function agree($params)
|
||||
{
|
||||
$id = $params[ 'id' ];
|
||||
$site_id = $params[ 'site_id' ];
|
||||
if (empty($site_id)) {
|
||||
return $this->error(-1, '参数错误');
|
||||
}
|
||||
$condition = array(
|
||||
['id', '=', $id],
|
||||
['site_id', '=', $site_id],
|
||||
$condition = array (
|
||||
[ 'id', '=', $id ],
|
||||
[ 'site_id', '=', $site_id ],
|
||||
);
|
||||
$info = model('fenxiao_withdraw')->getInfo($condition);
|
||||
|
||||
|
|
@ -614,25 +618,25 @@ class FenxiaoWithdraw extends BaseModel
|
|||
return $this->error();
|
||||
|
||||
$config_model = new Config();
|
||||
$config = $config_model->getFenxiaoWithdrawConfig($site_id)['data']['value'] ?? [];
|
||||
$config = $config_model->getFenxiaoWithdrawConfig($site_id)[ 'data' ][ 'value' ] ?? [];
|
||||
|
||||
model('fenxiao_withdraw')->startTrans();
|
||||
try {
|
||||
$data = array(
|
||||
'status' => 2,
|
||||
$data = array (
|
||||
'status' => 2,
|
||||
// 'status_name' => '待转账',//已审核待转账
|
||||
'audit_time' => time(),
|
||||
'audit_time' => time(),
|
||||
);
|
||||
$result = model('fenxiao_withdraw')->update($data, $condition);
|
||||
//是否启用自动转账(必须是微信或支付宝)
|
||||
if ($config['is_auto_transfer'] == 1) {
|
||||
$this->transfer(['id' => $id]);
|
||||
if ($config[ 'is_auto_transfer' ] == 1) {
|
||||
$this->transfer([ 'id' => $id ]);
|
||||
}
|
||||
model('fenxiao_withdraw')->commit();
|
||||
return $this->success();
|
||||
} catch (\Exception $e) {
|
||||
model('fenxiao_withdraw')->rollback();
|
||||
return $this->error('', $e->getMessage().$e->getLine());
|
||||
return $this->error('', $e->getMessage() . $e->getLine());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -642,25 +646,25 @@ class FenxiaoWithdraw extends BaseModel
|
|||
*/
|
||||
public function transfer($params)
|
||||
{
|
||||
$id = $params['id'];
|
||||
$site_id = $params['site_id'] ?? 0;
|
||||
$condition = array(
|
||||
['id', '=', $id],
|
||||
$id = $params[ 'id' ];
|
||||
$site_id = $params[ 'site_id' ] ?? 0;
|
||||
$condition = array (
|
||||
[ 'id', '=', $id ],
|
||||
);
|
||||
if($site_id > 0){
|
||||
$condition[] = ['site_id', '=', $site_id];
|
||||
if ($site_id > 0) {
|
||||
$condition[] = [ 'site_id', '=', $site_id ];
|
||||
}
|
||||
$info = model('fenxiao_withdraw')->getInfo($condition);
|
||||
if (empty($info))
|
||||
return $this->error();
|
||||
$site_id = $info['site_id'];
|
||||
$transfer_type = $info['transfer_type'];
|
||||
$member_id = $info['member_id'];
|
||||
$money = $info['money'];
|
||||
$fenxiao_id = $info['fenxiao_id'];
|
||||
$fenxiao_name = $info['fenxiao_name'];
|
||||
$real_money = $info['real_money'];
|
||||
if($transfer_type == 'balance'){
|
||||
$site_id = $info[ 'site_id' ];
|
||||
$transfer_type = $info[ 'transfer_type' ];
|
||||
$member_id = $info[ 'member_id' ];
|
||||
$money = $info[ 'money' ];
|
||||
$fenxiao_id = $info[ 'fenxiao_id' ];
|
||||
$fenxiao_name = $info[ 'fenxiao_name' ];
|
||||
$real_money = $info[ 'real_money' ];
|
||||
if ($transfer_type == 'balance') {
|
||||
//添加会员账户流水
|
||||
$member_account = new MemberAccount();
|
||||
$member_result = $member_account->addMemberAccount($site_id, $member_id, 'balance_money', $real_money, 'fenxiao', '佣金提现', '分销佣金提现');
|
||||
|
|
@ -668,28 +672,28 @@ class FenxiaoWithdraw extends BaseModel
|
|||
return $member_result;
|
||||
}
|
||||
|
||||
}else{
|
||||
if (!in_array($transfer_type, ['wechatpay', 'alipay']))
|
||||
} else {
|
||||
if (!in_array($transfer_type, [ 'wechatpay', 'alipay' ]))
|
||||
return $this->error('', '当前提现方式不支持在线转账');
|
||||
|
||||
$pay_data = array(
|
||||
$pay_data = array (
|
||||
'id' => $id,
|
||||
'out_trade_no' => $info['withdraw_no'],
|
||||
'real_name' => $info['realname'],
|
||||
'amount' => $info['real_money'],
|
||||
'desc' => '会员提现',
|
||||
'transfer_type' => $transfer_type,
|
||||
'account_number' => $info['account_number'],
|
||||
'site_id' => $info['site_id'],
|
||||
'is_weapp' => $info['applet_type'],
|
||||
'member_id' => $info['member_id']
|
||||
'out_trade_no' => $info[ 'withdraw_no' ],
|
||||
'real_name' => $info[ 'realname' ],
|
||||
'amount' => $info[ 'real_money' ],
|
||||
'desc' => '会员提现',
|
||||
'transfer_type' => $transfer_type,
|
||||
'account_number' => $info[ 'account_number' ],
|
||||
'site_id' => $info[ 'site_id' ],
|
||||
'is_weapp' => $info[ 'applet_type' ],
|
||||
'member_id' => $info[ 'member_id' ]
|
||||
);
|
||||
//调用在线转账借口
|
||||
$pay_result = event('PayTransfer', $pay_data, true);
|
||||
if (empty($pay_result)) {
|
||||
$pay_result = $this->error();
|
||||
}
|
||||
if ($pay_result['code'] < 0) {
|
||||
if ($pay_result[ 'code' ] < 0) {
|
||||
return $pay_result;
|
||||
}
|
||||
}
|
||||
|
|
@ -699,7 +703,7 @@ class FenxiaoWithdraw extends BaseModel
|
|||
return $account_result;
|
||||
}
|
||||
//调用完成转账
|
||||
$result = $this->transferFinish(['id' => $id, 'site_id' => $info['site_id']]);
|
||||
$result = $this->transferFinish([ 'id' => $id, 'site_id' => $info[ 'site_id' ] ]);
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
|
@ -710,16 +714,16 @@ class FenxiaoWithdraw extends BaseModel
|
|||
public function transferFinish($param = [])
|
||||
{
|
||||
$condition = [
|
||||
['id', '=', $param['id'] ],
|
||||
['site_id', '=', $param['site_id'] ],
|
||||
['status', '=', 2]
|
||||
[ 'id', '=', $param[ 'id' ] ],
|
||||
[ 'site_id', '=', $param[ 'site_id' ] ],
|
||||
[ 'status', '=', 2 ]
|
||||
];
|
||||
$info = model('fenxiao_withdraw')->getInfo($condition);
|
||||
if (empty($info)) return $this->error();
|
||||
$site_id = $info['site_id'];
|
||||
$member_id = $info['member_id'];
|
||||
$fenxiao_id = $info['fenxiao_id'];
|
||||
$money = $info['money'];
|
||||
$site_id = $info[ 'site_id' ];
|
||||
$member_id = $info[ 'member_id' ];
|
||||
$fenxiao_id = $info[ 'fenxiao_id' ];
|
||||
$money = $info[ 'money' ];
|
||||
$payment_time = time();
|
||||
model('fenxiao_withdraw')->startTrans();
|
||||
try {
|
||||
|
|
@ -727,13 +731,13 @@ class FenxiaoWithdraw extends BaseModel
|
|||
'status' => 3,
|
||||
'status_name' => '已转账',
|
||||
'payment_time' => $payment_time,
|
||||
'document' => $param['certificate'] ?? '',
|
||||
'transfer_remark' => $param['certificate_remark'] ?? ''
|
||||
'document' => $param[ 'certificate' ] ?? '',
|
||||
'transfer_remark' => $param[ 'certificate_remark' ] ?? ''
|
||||
];
|
||||
$result = model('fenxiao_withdraw')->update($data, $condition);
|
||||
|
||||
$fenxiao_condition = array(
|
||||
['fenxiao_id', '=', $fenxiao_id]
|
||||
$fenxiao_condition = array (
|
||||
[ 'fenxiao_id', '=', $fenxiao_id ]
|
||||
);
|
||||
//修改分销商提现中金额
|
||||
model('fenxiao')->setDec($fenxiao_condition, 'account_withdraw_apply', $money);
|
||||
|
|
@ -742,7 +746,7 @@ class FenxiaoWithdraw extends BaseModel
|
|||
|
||||
model('fenxiao_withdraw')->commit();
|
||||
|
||||
$member_info = model('member')->getInfo([['member_id', '=', $member_id]], 'nickname');
|
||||
// $member_info = model('member')->getInfo([ [ 'member_id', '=', $member_id ] ], 'nickname');
|
||||
|
||||
// $stat_model = new Stat();
|
||||
// $stat_model->switchStat(['type' => 'member_withdraw', 'data' => ['site_id' => $info['site_id'], 'id' => $info['id']]]);
|
||||
|
|
@ -763,26 +767,26 @@ class FenxiaoWithdraw extends BaseModel
|
|||
*/
|
||||
public function refuse($params)
|
||||
{
|
||||
$id = $params['id'];
|
||||
$site_id = $params['site_id'];
|
||||
$id = $params[ 'id' ];
|
||||
$site_id = $params[ 'site_id' ];
|
||||
$data = [
|
||||
'status' => -1,
|
||||
"refuse_reason" => $params["refuse_reason"],
|
||||
"audit_time" => time(),
|
||||
"refuse_reason" => $params[ "refuse_reason" ],
|
||||
"audit_time" => time(),
|
||||
];
|
||||
$condition = array(
|
||||
['id', '=', $id],
|
||||
['site_id', '=', $site_id]
|
||||
$condition = array (
|
||||
[ 'id', '=', $id ],
|
||||
[ 'site_id', '=', $site_id ]
|
||||
);
|
||||
$info = model('fenxiao_withdraw')->getInfo($condition, '*');
|
||||
if(empty($info)) return $this->error();
|
||||
if (empty($info)) return $this->error();
|
||||
model('fenxiao_withdraw')->startTrans();
|
||||
try {
|
||||
$money = $info['money'];
|
||||
$fenxiao_id = $info['fenxiao_id'];
|
||||
$money = $info[ 'money' ];
|
||||
$fenxiao_id = $info[ 'fenxiao_id' ];
|
||||
if ($info[ 'status' ] == 1) {
|
||||
model('fenxiao_withdraw')->update($data, $condition);
|
||||
$fenxiao_condition = array(
|
||||
$fenxiao_condition = array (
|
||||
[ 'fenxiao_id', '=', $fenxiao_id ]
|
||||
);
|
||||
//修改分销商提现中金额
|
||||
|
|
@ -795,8 +799,6 @@ class FenxiaoWithdraw extends BaseModel
|
|||
$message_model = new Message();
|
||||
$info[ 'keywords' ] = 'FENXIAO_WITHDRAWAL_ERROR';
|
||||
$message_model->sendMessage($info);
|
||||
|
||||
|
||||
}
|
||||
model('fenxiao_withdraw')->commit();
|
||||
return $this->success();
|
||||
|
|
@ -806,7 +808,8 @@ class FenxiaoWithdraw extends BaseModel
|
|||
}
|
||||
}
|
||||
|
||||
public function exportFenxiaoWithdraw($condition, $order, $site_id){
|
||||
public function exportFenxiaoWithdraw($condition, $order, $site_id)
|
||||
{
|
||||
try {
|
||||
$file_name = date('Y年m月d日-分销提现', time()) . '.csv';
|
||||
// $file_name = date('YmdHis').'.csv';//csv文件名
|
||||
|
|
@ -829,24 +832,24 @@ class FenxiaoWithdraw extends BaseModel
|
|||
//将数据格式化为CSV格式并写入到output流中
|
||||
fputcsv($fp, $heade);
|
||||
$transfer_type_list = $this->getTransferType($site_id);
|
||||
$status_name = [1 =>"待审核", 2 => "待转账", 3 => "已转账", -1 => "已拒绝", -2 => "转账失败"];
|
||||
$status_name = [ 1 => "待审核", 2 => "待转账", 3 => "已转账", -1 => "已拒绝", -2 => "转账失败" ];
|
||||
//写入第一行表头
|
||||
Db::name('fenxiao_withdraw')->where($condition)->order($order)->chunk(500, function($item_list) use ($fp, $transfer_type_list, $status_name) {
|
||||
//写入导出信息
|
||||
foreach ($item_list as $k => $item_v) {
|
||||
$temp_data = [
|
||||
$item_v['fenxiao_name'] . "\t",
|
||||
$transfer_type_list[$item_v['transfer_type']]. "\t",
|
||||
$item_v[ 'fenxiao_name' ] . "\t",
|
||||
$transfer_type_list[ $item_v[ 'transfer_type' ] ] . "\t",
|
||||
(float) $item_v[ 'money' ] . "\t",
|
||||
(float) $item_v[ 'withdraw_rate_money' ] . "\t",
|
||||
(float) $item_v[ 'real_money' ] . "\t",
|
||||
$status_name[$item_v[ 'status' ]] . "\t",
|
||||
$status_name[ $item_v[ 'status' ] ] . "\t",
|
||||
time_to_date($item_v[ 'create_time' ]) . "\t",
|
||||
$item_v['account_number']. "\t",
|
||||
$item_v['realname']. "\t",
|
||||
$item_v['mobile']. "\t",
|
||||
$item_v['bank_name']. "\t",
|
||||
$item_v['transfer_account_no']. "\t",
|
||||
$item_v[ 'account_number' ] . "\t",
|
||||
$item_v[ 'realname' ] . "\t",
|
||||
$item_v[ 'mobile' ] . "\t",
|
||||
$item_v[ 'bank_name' ] . "\t",
|
||||
$item_v[ 'transfer_account_no' ] . "\t",
|
||||
];
|
||||
mb_convert_variables('GBK', 'UTF-8', $temp_data);
|
||||
fputcsv($fp, $temp_data);
|
||||
|
|
|
|||
|
|
@ -1,19 +1,16 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
namespace addon\fenxiao\model;
|
||||
|
||||
use app\model\BaseModel;
|
||||
use extend\Poster as PosterExtend;
|
||||
use app\model\upload\Upload;
|
||||
|
||||
/**
|
||||
* 海报生成类
|
||||
*/
|
||||
|
|
@ -33,13 +30,10 @@ class Poster extends BaseModel
|
|||
try {
|
||||
$qrcode_info = $this->getQrcode($app_type, $page, $qrcode_param, $site_id);
|
||||
if ($qrcode_info[ 'code' ] < 0) return $qrcode_info;
|
||||
|
||||
$member_info = $this->getMemberInfo($qrcode_param[ 'source_member' ]);
|
||||
if (empty($member_info)) return $this->error('未获取到会员信息');
|
||||
|
||||
$poster = new PosterExtend(740, 1250);
|
||||
if (empty($template_info)) {
|
||||
|
||||
$option = [
|
||||
[
|
||||
'action' => 'imageCopy', // 背景图
|
||||
|
|
@ -109,12 +103,11 @@ class Poster extends BaseModel
|
|||
$poster = new PosterExtend(740, 1250);
|
||||
$fontRate = 0.725;
|
||||
$nickname_color = is_array($params[ 'template_json' ][ 'nickname_color' ]) ? $params[ 'template_json' ][ 'nickname_color' ] : hex2rgb($params[ 'template_json' ][ 'nickname_color' ]);
|
||||
|
||||
$option = [
|
||||
[
|
||||
'action' => 'imageCopy', // 写入背景图
|
||||
'data' => [
|
||||
img($params[ 'background' ]),
|
||||
$params[ 'background' ],
|
||||
0,
|
||||
0,
|
||||
740,
|
||||
|
|
@ -177,10 +170,8 @@ class Poster extends BaseModel
|
|||
]
|
||||
],
|
||||
];
|
||||
|
||||
}
|
||||
$option_res = $poster->create($option);
|
||||
|
||||
if (is_array($option_res)) return $option_res;
|
||||
$pic_name = "";
|
||||
if (!empty($params)) {
|
||||
|
|
@ -190,7 +181,6 @@ class Poster extends BaseModel
|
|||
]));
|
||||
$pic_name = "_" . $pic_name;
|
||||
}
|
||||
|
||||
$res = $option_res->jpeg('upload/poster/distribution', 'distribution_' . $qrcode_param[ 'source_member' ] . $pic_name . '_' . $app_type);
|
||||
if ($res[ 'code' ] == 0) {
|
||||
$upload = new Upload($site_id);
|
||||
|
|
@ -250,7 +240,6 @@ class Poster extends BaseModel
|
|||
$site_id = $param[ 'site_id' ] ?? 0;
|
||||
$page = $param[ 'page' ] ?? '';
|
||||
$template_id = $param[ 'template_id' ] ?? 'default';
|
||||
|
||||
if ($template_id == 'default') {
|
||||
//默认海报
|
||||
$template_info = null;
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
* 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和使用。
|
||||
* 任何企业和个人不允许对程序代码以任何形式任何目的再发布。
|
||||
* =========================================================
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,11 +1,11 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
|
||||
* =========================================================
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -1,97 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* SAAS应用系统 --- 十年开发经验汇集巨献!
|
||||
* ==========================================================
|
||||
* Copy right 2020-2050 成都众联思索科技有限公司,保留所有权利。
|
||||
* ----------------------------------------------------------
|
||||
* 官方网址: https://www.zoomtk.com
|
||||
* 这不是自由软件!未经允许不得用于商业目或程序代码摘取及修改。
|
||||
* 任何企业和个人未经允许对程序代码以任何形式任何目的再发布传播。
|
||||
* 唯一发布渠道www.zoomtk.com;非官方渠道统一视为侵权行为。
|
||||
* ==========================================================
|
||||
*/
|
||||
namespace addon\fenxiao\shop\controller;
|
||||
use addon\fenxiao\model\Config as ConfigModel;
|
||||
use addon\fenxiao\model\AgeenLevel;
|
||||
use app\shop\controller\BaseShop;
|
||||
class Agentlevel extends BaseShop
|
||||
{
|
||||
/**
|
||||
* 等级列表
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
$model = new AgeenLevel();
|
||||
if (request()->isAjax()) {
|
||||
$page = input('page', 1);
|
||||
$page_size = input('page_size', PAGE_LIST_ROWS);
|
||||
$list = $model->getLevelPageList([['site_id', '=', $this->site_id]], $page, $page_size, '', '*');
|
||||
return $list;
|
||||
} else {
|
||||
// //获取系统配置
|
||||
// $config_model = new ConfigModel();
|
||||
// $basics = $config_model->getFenxiaoBasicsConfig($this->site_id);
|
||||
// $this->assign("basics_info", $basics['data']['value']);
|
||||
return $this->fetch('agentlevel/lists');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加等级
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
$model = new AgeenLevel();
|
||||
if (request()->isAjax()) {
|
||||
$data = [
|
||||
'site_id' => $this->site_id,
|
||||
'level_name' => input('level_name', ''),
|
||||
'type' => input('type', ''),
|
||||
'remark' => input('remark', ''),
|
||||
'flower_multiple' => input('flower_multiple', ''),
|
||||
'flower_times' => input('flower_times', '')
|
||||
];
|
||||
$res = $model->addLevel($data);
|
||||
return $res;
|
||||
} else {
|
||||
return $this->fetch('agentlevel/add');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑等级
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$model = new AgeenLevel();
|
||||
if (request()->isAjax()) {
|
||||
$data = [
|
||||
'level_name' => input('level_name', ''),
|
||||
'type' => input('type', ''),
|
||||
'remark' => input('remark', ''),
|
||||
'flower_multiple' => input('flower_multiple', 0),
|
||||
'flower_times' => input('flower_times', '')
|
||||
];
|
||||
$level_id = input('level_id', '');
|
||||
$res = $model->editLevel($data, [['level_id', '=', $level_id], ['site_id', '=', $this->site_id]]);
|
||||
return $res;
|
||||
} else {
|
||||
$level_id = input('level_id', '');
|
||||
$info = $model->getLevelInfo([['level_id', '=', $level_id], ['site_id', '=', $this->site_id]]);
|
||||
if (empty($info['data'])) return $this->error('未获取到等级数据', addon_url('fenxiao://shop/agentlevel/lists'));
|
||||
$this->assign('info', $info['data']);
|
||||
}
|
||||
return $this->fetch('agentlevel/edit');
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除分销等级
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$model = new AgeenLevel();
|
||||
$level_id = input('level_id', '');
|
||||
$res = $model->deleteLevel($level_id, $this->site_id);
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,160 +0,0 @@
|
|||
<?php
|
||||
/**
|
||||
* SAAS应用系统 --- 十年开发经验汇集巨献!
|
||||
* ==========================================================
|
||||
* Copy right 2020-2050 成都众联思索科技有限公司,保留所有权利。
|
||||
* ----------------------------------------------------------
|
||||
* 官方网址: https://www.zoomtk.com
|
||||
* 这不是自由软件!未经允许不得用于商业目或程序代码摘取及修改。
|
||||
* 任何企业和个人未经允许对程序代码以任何形式任何目的再发布传播。
|
||||
* 唯一发布渠道www.zoomtk.com;非官方渠道统一视为侵权行为。
|
||||
* ==========================================================
|
||||
*/
|
||||
namespace addon\fenxiao\shop\controller;
|
||||
use addon\fenxiao\model\Ageen;
|
||||
use addon\fenxiao\model\Config as ConfigModel;
|
||||
use addon\fenxiao\model\Fenxiao as FenxiaoModel;
|
||||
use addon\fenxiao\model\AgeenLevel;
|
||||
use app\model\system\Address as AddressModel;
|
||||
use app\shop\controller\BaseShop;
|
||||
use think\facade\Db;
|
||||
class Area extends BaseShop
|
||||
{
|
||||
/**
|
||||
* 区域列表
|
||||
*/
|
||||
public function lists()
|
||||
{
|
||||
$model = new Ageen();
|
||||
if (request()->isAjax()) {
|
||||
$condition = [];
|
||||
$condition[] = ['f.site_id', '=', $this->site_id];
|
||||
// $condition[] = ['f.is_area_agent', '=', 1];
|
||||
$search_text_type=input('search_text_type');
|
||||
$search_text=input('search_text');
|
||||
switch ($search_text_type){
|
||||
case 'fenxiao_name' :
|
||||
$condition[] = ['f.fenxiao_name', 'like', '%' . $search_text . '%'];
|
||||
break;
|
||||
case 'mobile' :
|
||||
$condition[] = ['m.mobile', '=', $search_text];
|
||||
break;
|
||||
case 'nickname' :
|
||||
$condition[] = ['f.nickname', 'like', '%' . $search_text . '%'];
|
||||
break;
|
||||
case 'member_id' :
|
||||
$condition[] = ['f.member_id', '=', $search_text];
|
||||
break;
|
||||
}
|
||||
$level_id = input('level_id', '');
|
||||
if ($level_id) {
|
||||
$condition[] = ['f.level_id', '=', $level_id];
|
||||
}
|
||||
$start_time = input('start_time', '');
|
||||
$end_time = input('end_time', '');
|
||||
if ($start_time && $end_time) {
|
||||
$condition[] = ['f.create_time', 'between', [date_to_time($start_time), date_to_time($end_time)]];
|
||||
} elseif (!$start_time && $end_time) {
|
||||
$condition[] = ['f.create_time', '<=', date_to_time($end_time)];
|
||||
|
||||
} elseif ($start_time && !$end_time) {
|
||||
$condition[] = ['f.create_time', '>=', date_to_time($start_time)];
|
||||
}
|
||||
$status = input('status', '');
|
||||
if (!empty($status)) {
|
||||
$condition[] = ['f.status', '=', $status];
|
||||
}
|
||||
$page = input('page', 1);
|
||||
$page_size = input('page_size', PAGE_LIST_ROWS);
|
||||
// $list = $model->getPageList($condition, $page, $page_size, 'f.create_time desc,a.create_time desc');
|
||||
$list = $model->getPageList($condition, $page, $page_size, '');
|
||||
return $list;
|
||||
|
||||
} else {
|
||||
$level_model = new AgeenLevel();
|
||||
$level_list = $level_model->getLevelList([['status', '=', 1], ['site_id', '=', $this->site_id]], 'level_id,level_name');
|
||||
$this->assign('level_list', $level_list['data']);
|
||||
$config_model = new ConfigModel();
|
||||
$basics = $config_model->getFenxiaoBasicsConfig($this->site_id);
|
||||
$this->assign("basics_info", $basics['data']['value']);
|
||||
// $this->forthMenu();
|
||||
return $this->fetch('area/lists');
|
||||
}
|
||||
}
|
||||
/***
|
||||
* 添加代理商
|
||||
* @return array|mixed
|
||||
*/
|
||||
public function add(){
|
||||
//获取分销商列表
|
||||
$ageen_model = new Ageen();
|
||||
$fenxiao_model = new FenxiaoModel();
|
||||
//获取分销商等级
|
||||
$level_model = new AgeenLevel();
|
||||
if (request()->isAjax()) {
|
||||
$fenxiao_id= input('fenxiao_id',0);//上级分销商ID
|
||||
$province_id= input('province_id',0);
|
||||
$city_id= input('city_id',0);
|
||||
$district_id= input('district_id',0);
|
||||
$level_id= input('level_id',0);
|
||||
$fenxiao_data = [
|
||||
'fenxiao_id' => $fenxiao_id,
|
||||
'agent_level_id' => input('level_id',''),
|
||||
'agent_level_name' => input('agent_level_name',''),
|
||||
// 'is_area_agent' => 1,
|
||||
'province_id' => input('province_id',0),
|
||||
'city_id' => input('city_id',0),
|
||||
'district_id' => input('district_id',0)
|
||||
];
|
||||
$fenxiao=Db::name('fenxiao_agent')
|
||||
->whereOr('province_id','=',$province_id)
|
||||
->whereOr('city_id','=',$city_id)
|
||||
->whereOr('district_id','=',$district_id)
|
||||
->field('province_id,city_id,district_id,agent_level_id,fenxiao_id')
|
||||
->select();
|
||||
if($fenxiao){
|
||||
$area=array_column($fenxiao->toArray(),'agent_level_id');
|
||||
if(in_array($level_id,$area)){
|
||||
return error(-1,'当前区域已存在代理商');
|
||||
}
|
||||
}
|
||||
return $ageen_model->add($fenxiao_data);
|
||||
} else {
|
||||
$level_list = $level_model->getLevelList([['status', '=', 1], ['site_id', '=', $this->site_id]], 'level_id,level_name');
|
||||
$this->assign('level_list', $level_list['data']);
|
||||
$condition[] = ['status','=','1'];
|
||||
// $condition[] = ['is_area_agent','=','0'];
|
||||
$fenxiao_list = $fenxiao_model->getFenxiaoList($condition, 'fenxiao_id,fenxiao_name');
|
||||
$this->assign('fenxiao_list', $fenxiao_list['data']);
|
||||
//查询省级数据列表
|
||||
$address_model = new AddressModel();
|
||||
$list = $address_model->getAreaList([["pid", "=", 0], ["level", "=", 1]]);
|
||||
$this->assign("province_list", $list["data"]);
|
||||
return $this->fetch('area/add');
|
||||
}
|
||||
}
|
||||
public function remove(){
|
||||
//获取分销商列表
|
||||
$fenxiao_model = new Ageen();
|
||||
$id= input('id',0);//上级分销商ID
|
||||
if(request()->isAjax()&&$id){
|
||||
return $fenxiao_model->delete($id);
|
||||
}
|
||||
}
|
||||
/***
|
||||
* 查询分销商
|
||||
* @return array
|
||||
*/
|
||||
public function getfenxiaolist(){
|
||||
$page_index = input('page', 1);
|
||||
$page_size = input('page_size', PAGE_LIST_ROWS);
|
||||
$fenxiao_search = input("fenxiao_search", '');
|
||||
$condition = [];
|
||||
$condition[] = [ 'mobile|fenxiao_name', 'like', '%'.$fenxiao_search.'%' ];
|
||||
$condition[] = [ 'status', '=', 1 ];
|
||||
// $condition[] = [ 'is_area_agent', '=', 0 ];
|
||||
$fenxiao_model = new FenxiaoModel();
|
||||
$list = $fenxiao_model->getFenxiaoPageLists($condition,$page_index,$page_size,'','fenxiao_id,fenxiao_name,account');
|
||||
return $list;
|
||||
}
|
||||
}
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
|
@ -29,9 +29,7 @@ class Config extends BaseShop
|
|||
public function basics()
|
||||
{
|
||||
$model = new ConfigModel();
|
||||
|
||||
if (request()->isAjax()) {
|
||||
|
||||
$data = [
|
||||
'level' => input('level', ''),//分销层级
|
||||
'internal_buy' => input('internal_buy', ''),//分销内购
|
||||
|
|
@ -49,26 +47,15 @@ class Config extends BaseShop
|
|||
'one_rate' => input('one_rate', 0.00),
|
||||
'two_rate' => input('two_rate', 0.00),
|
||||
'three_rate' => input('three_rate', 0.00),
|
||||
'newuser_points' => input('newuser_points', 0),
|
||||
'order_give_points_ratio' => input('order_give_points_ratio', 0),
|
||||
'order_give_contribution_ratio' => input('order_give_contribution_ratio', 0),
|
||||
'order_give_house_purchase_ratio' => input('order_give_house_purchase_ratio', 0),
|
||||
'order_give_a_points_ratio' => input('order_give_a_points_ratio', 0),
|
||||
'order_give_a_contribution_ratio' => input('order_give_a_contribution_ratio', 0),
|
||||
'order_give_d_points_ratio' => input('order_give_d_points_ratio', 0),
|
||||
'order_give_d_contribution_ratio' => input('order_give_d_contribution_ratio', 0),
|
||||
'no_contribution_points_ratio' => input('no_contribution_points_ratio', 0),
|
||||
'contribution_points_ratio' => input('contribution_points_ratio', 0),
|
||||
'settlement_points_to_balance_money_ratio' => input('settlement_points_to_balance_money_ratio', 0),
|
||||
'settlement_points_to_point_ratio' => input('settlement_points_to_point_ratio', 0),
|
||||
// 'violation_unpaid' => (int)input('violation_unpaid', 0),
|
||||
// 'violation_hour' => (int)input('violation_hour', 0),
|
||||
|
||||
'upgrade_agree' => input('upgrade_agree', ''),
|
||||
];
|
||||
|
||||
$res = $model->setFenxiaoBasicsConfig($data, 1, $this->site_id);
|
||||
return $res;
|
||||
} else {
|
||||
$basics = $model->getFenxiaoBasicsConfig($this->site_id);
|
||||
// var_dump($basics);die;
|
||||
$this->assign("basics_info", $basics[ 'data' ][ 'value' ]);
|
||||
|
||||
$fenxiao = $model->getFenxiaoConfig($this->site_id);
|
||||
|
|
@ -104,9 +91,7 @@ class Config extends BaseShop
|
|||
public function agreement()
|
||||
{
|
||||
$model = new ConfigModel();
|
||||
|
||||
if (request()->isAjax()) {
|
||||
|
||||
$data = [
|
||||
'is_agreement' => input('is_agreement', ''),//是否显示申请协议
|
||||
'agreement_title' => input('agreement_title', ''),//协议标题
|
||||
|
|
@ -115,15 +100,12 @@ class Config extends BaseShop
|
|||
];
|
||||
$res = $model->setFenxiaoAgreementConfig($data, 1, $this->site_id);
|
||||
return $res;
|
||||
|
||||
} else {
|
||||
$agreement = $model->getFenxiaoAgreementConfig($this->site_id);
|
||||
$this->assign("agreement_info", $agreement[ 'data' ][ 'value' ]);
|
||||
|
||||
$document_model = new Document();
|
||||
$document = $document_model->getDocument([ [ 'site_id', '=', $this->site_id ], [ 'app_module', '=', 'shop' ], [ 'document_key', '=', "FENXIAO_AGREEMENT" ] ]);
|
||||
$this->assign('document', $document[ 'data' ]);
|
||||
|
||||
$this->forthMenu();
|
||||
return $this->fetch('config/agreement');
|
||||
}
|
||||
|
|
@ -208,13 +190,12 @@ class Config extends BaseShop
|
|||
*/
|
||||
public function promoteRule()
|
||||
{
|
||||
$document_model = new Document();
|
||||
if (request()->isAjax()) {
|
||||
$content = input('content', '');
|
||||
$document_model = new Document();
|
||||
$res = $document_model->setDocument('分销推广规则', $content, [ [ 'site_id', '=', $this->site_id ], [ 'app_module', '=', 'shop' ], [ 'document_key', '=', "FENXIAO_PROMOTE_RULE" ] ]);
|
||||
return $res;
|
||||
} else {
|
||||
$document_model = new Document();
|
||||
$document = $document_model->getDocument([ [ 'site_id', '=', $this->site_id ], [ 'app_module', '=', 'shop' ], [ 'document_key', '=', "FENXIAO_PROMOTE_RULE" ] ]);
|
||||
$this->assign('document', $document[ 'data' ]);
|
||||
$this->forthMenu();
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
|
@ -15,13 +15,11 @@ use addon\fenxiao\model\Fenxiao as FenxiaoModel;
|
|||
use addon\fenxiao\model\FenxiaoAccount;
|
||||
use addon\fenxiao\model\FenxiaoApply;
|
||||
use addon\fenxiao\model\FenxiaoData;
|
||||
use addon\fenxiao\model\FenxiaoLevel;
|
||||
use addon\fenxiao\model\FenxiaoLevel as FenxiaoLevelModel;
|
||||
use addon\fenxiao\model\FenxiaoOrder as FenxiaoOrderModel;
|
||||
use app\model\goods\Goods as GoodsModel;
|
||||
use app\model\member\Member as MemberModel;
|
||||
use app\shop\controller\BaseShop;
|
||||
use think\facade\Db;
|
||||
|
||||
/**
|
||||
* 分销设置
|
||||
|
|
@ -48,12 +46,15 @@ class Fenxiao extends BaseShop
|
|||
$fenxiao_data_model = new FenxiaoData();
|
||||
$account_data = $fenxiao_data_model->getFenxiaoAccountData($this->site_id);
|
||||
$this->assign('account_data', $account_data);
|
||||
|
||||
//累计佣金
|
||||
$fenxiao_account = number_format($account_data[ 'account' ], 2, '.', '');
|
||||
$this->assign('fenxiao_account', $fenxiao_account);
|
||||
|
||||
//获取申请人数
|
||||
$fenxiao_apply_num = $fenxiao_data_model->getFenxiaoApplyCount($this->site_id);
|
||||
$this->assign('fenxiao_apply_num', $fenxiao_apply_num);
|
||||
|
||||
//分销商人数
|
||||
$fenxiao_num = $fenxiao_data_model->getFenxiaoCount($this->site_id);
|
||||
$this->assign('fenxiao_num', $fenxiao_num);
|
||||
|
|
@ -94,7 +95,7 @@ class Fenxiao extends BaseShop
|
|||
$commission_money = number_format($commission_money, 2);
|
||||
$this->assign('commission_money', $commission_money);
|
||||
|
||||
// $this->forthMenu();
|
||||
$this->forthMenu();
|
||||
return $this->fetch('fenxiao/index');
|
||||
}
|
||||
|
||||
|
|
@ -159,7 +160,7 @@ class Fenxiao extends BaseShop
|
|||
$basics = $config_model->getFenxiaoBasicsConfig($this->site_id);
|
||||
$this->assign("basics_info", $basics[ 'data' ][ 'value' ]);
|
||||
|
||||
// $this->forthMenu();
|
||||
$this->forthMenu();
|
||||
return $this->fetch('fenxiao/lists');
|
||||
}
|
||||
}
|
||||
|
|
@ -254,7 +255,7 @@ class Fenxiao extends BaseShop
|
|||
$this->assign('level', $fenxiao_level[ 'data' ]);
|
||||
$this->assign('info', $info[ 'data' ]);
|
||||
|
||||
// $this->forthMenu([ 'fenxiao_id' => $fenxiao_id ]);
|
||||
$this->forthMenu([ 'fenxiao_id' => $fenxiao_id ]);
|
||||
return $this->fetch('fenxiao/fenxiao_detail');
|
||||
}
|
||||
|
||||
|
|
@ -306,7 +307,7 @@ class Fenxiao extends BaseShop
|
|||
}
|
||||
$this->assign('fenxiao_id', $fenxiao_id);
|
||||
|
||||
// $this->forthMenu([ 'fenxiao_id' => $fenxiao_id ]);
|
||||
$this->forthMenu([ 'fenxiao_id' => $fenxiao_id ]);
|
||||
return $this->fetch('fenxiao/fenxiao_account');
|
||||
}
|
||||
|
||||
|
|
@ -318,14 +319,14 @@ class Fenxiao extends BaseShop
|
|||
$fenxiao_id = input('fenxiao_id', 0);
|
||||
$fenxiao_model = new FenxiaoModel();
|
||||
if (request()->isAjax()) {
|
||||
$level = input('level', 0);
|
||||
$level = input('level', 1);
|
||||
$page = input('page', 1);
|
||||
$page_size = input('page_size', PAGE_LIST_ROWS);
|
||||
$list = $fenxiao_model->getFenxiaoTeam($level, $fenxiao_id, $page, $page_size);
|
||||
return $list;
|
||||
} else {
|
||||
$this->assign('fenxiao_id', $fenxiao_id);
|
||||
// $this->forthMenu([ 'fenxiao_id' => $fenxiao_id ]);
|
||||
$this->forthMenu([ 'fenxiao_id' => $fenxiao_id ]);
|
||||
|
||||
$config_model = new ConfigModel();
|
||||
$basics_config = $config_model->getFenxiaoBasicsConfig($this->site_id);
|
||||
|
|
@ -378,7 +379,7 @@ class Fenxiao extends BaseShop
|
|||
} else {
|
||||
//订单状态
|
||||
$this->assign('fenxiao_id', $fenxiao_id);
|
||||
// $this->forthMenu([ 'fenxiao_id' => $fenxiao_id ]);
|
||||
$this->forthMenu([ 'fenxiao_id' => $fenxiao_id ]);
|
||||
return $this->fetch('fenxiao/order_lists', [], $this->replace);
|
||||
}
|
||||
}
|
||||
|
|
@ -471,7 +472,7 @@ class Fenxiao extends BaseShop
|
|||
}
|
||||
|
||||
$join = [
|
||||
['member m', 'fa.member_id = m.member_id', 'inner']
|
||||
[ 'member m', 'fa.member_id = m.member_id', 'inner' ]
|
||||
];
|
||||
$field = 'fa.apply_id,fa.fenxiao_name,fa.parent,fa.member_id,fa.level_id,fa.level_name,fa.order_complete_money,fa.order_complete_num,fa.reg_time,fa.create_time,fa.status,m.mobile,m.nickname,m.headimg';
|
||||
|
||||
|
|
@ -486,7 +487,7 @@ class Fenxiao extends BaseShop
|
|||
$level_list = $level_model->getLevelList([ [ 'status', '=', 1 ] ], 'level_id,level_name');
|
||||
$this->assign('level_list', $level_list[ 'data' ]);
|
||||
|
||||
// $this->forthMenu();
|
||||
$this->forthMenu();
|
||||
return $this->fetch('fenxiao/apply');
|
||||
}
|
||||
}
|
||||
|
|
@ -684,147 +685,4 @@ class Fenxiao extends BaseShop
|
|||
return $res;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 购房券
|
||||
*/
|
||||
public function adjustHousePurchase()
|
||||
{
|
||||
$fenxiao_id = input('fenxiao_id', 0);
|
||||
$adjust_num = input('adjust_num', 0);
|
||||
// $remark = input('remark', '商家调整');
|
||||
$remark = '后台核销';
|
||||
// $this->addLog("会员余额调整id:" . $member_id . "金额" . $adjust_num);
|
||||
$fenxiao = model('fenxiao')->getInfo(['fenxiao_id' => $fenxiao_id, 'site_id' => $this->site_id], 'fenxiao_id,fenxiao_name,parent,grand_parent');
|
||||
$fenxiao_account_model = new FenxiaoAccount();
|
||||
return $fenxiao_account_model->addAccount($fenxiao['fenxiao_id'], $fenxiao['fenxiao_name'], 'house_purchase', -$adjust_num, $fenxiao['fenxiao_id'], 'house_purchase', $remark);
|
||||
}
|
||||
|
||||
/**
|
||||
* Common: 代理申请
|
||||
* Author: wu-hui
|
||||
* Time: 2023/02/27 11:44
|
||||
* @return array|mixed
|
||||
*/
|
||||
public function upgradeApply(){
|
||||
if (request()->isAjax()) {
|
||||
// 参数获取
|
||||
$page = input('page',1);
|
||||
$pageSize = input('page_size',PAGE_LIST_ROWS);
|
||||
$nickname = input('nickname','');
|
||||
$status = (int)input('status',0);//申请状态(1申请中 2通过 3驳回)
|
||||
// 获取内容
|
||||
$field = [
|
||||
'm.username',
|
||||
'm.nickname',
|
||||
'm.headimg',
|
||||
'a.id',
|
||||
'a.member_id',
|
||||
'a.username',
|
||||
'a.phone',
|
||||
'a.id_card',
|
||||
'a.id_card_front',
|
||||
'a.id_card_reverse',
|
||||
'a.update_time',
|
||||
'a.status',
|
||||
];
|
||||
// 表关联
|
||||
$join = [
|
||||
['member m', 'm.member_id = a.member_id', 'left'],
|
||||
];
|
||||
// 条件生成
|
||||
$condition = [
|
||||
['a.site_id','=',$this->site_id]
|
||||
];
|
||||
if($nickname) $condition[] = ['m.username|m.nickname|m.username',"like","%{$nickname}%"];
|
||||
if($status > 0) $condition[] = ['a.status',"=",$status];
|
||||
|
||||
return (new FenxiaoApply())->getPageList($condition, $page, $pageSize, 'a.update_time desc,a.id desc', $field, 'a', $join);
|
||||
}
|
||||
else {
|
||||
|
||||
//$this->forthMenu();
|
||||
return $this->fetch('fenxiao/upgrade_apply');
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Common: 分销商升级审核
|
||||
* Author: wu-hui
|
||||
* Time: 2023/02/27 13:51
|
||||
* @return array
|
||||
*/
|
||||
public function upgradeExamine(){
|
||||
|
||||
return (new FenxiaoApply())->upgradeApplyExamine();
|
||||
}
|
||||
/**
|
||||
* Common: 分销商流水
|
||||
* Author: wu-hui
|
||||
* Time: 2023/03/23 11:40
|
||||
* @return array|mixed
|
||||
*/
|
||||
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)];
|
||||
// 是否获取钻石:获取钻石-仅获取钻石流水,不获取钻石-获取除钻石外所有流水
|
||||
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 = [
|
||||
['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');
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
|
@ -68,7 +68,7 @@ class Goods extends BaseShop
|
|||
$list = $model->getGoodsPageList($condition, $page_index, $page_size);
|
||||
return $list;
|
||||
} else {
|
||||
// $this->forthMenu();
|
||||
$this->forthMenu();
|
||||
return $this->fetch('goods/lists');
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
|
@ -32,7 +32,7 @@ class Level extends BaseShop
|
|||
|
||||
$page = input('page', 1);
|
||||
$page_size = input('page_size', PAGE_LIST_ROWS);
|
||||
$list = $model->getLevelPageList([ [ 'site_id', '=', $this->site_id ] ], $page, $page_size, 'level_num asc,one_rate asc', $field);
|
||||
$list = $model->getLevelPageList([ [ 'site_id', '=', $this->site_id ], ['is_default', '=', 0] ], $page, $page_size, 'level_num asc,one_rate asc', $field);
|
||||
if (!empty($list[ 'data' ][ 'list' ])) {
|
||||
foreach ($list[ 'data' ][ 'list' ] as $key => $val) {
|
||||
$fenxiao_model = new Fenxiao();
|
||||
|
|
@ -44,7 +44,7 @@ class Level extends BaseShop
|
|||
return $list;
|
||||
|
||||
} else {
|
||||
//$this->forthMenu();
|
||||
$this->forthMenu();
|
||||
//获取系统配置
|
||||
$config_model = new ConfigModel();
|
||||
$basics = $config_model->getFenxiaoBasicsConfig($this->site_id);
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
|
@ -67,7 +67,7 @@ class Order extends BaseShop
|
|||
return $list;
|
||||
|
||||
} else {
|
||||
// $this->forthMenu();
|
||||
$this->forthMenu();
|
||||
//订单状态
|
||||
return $this->fetch('order/lists', [], $this->replace);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
|
@ -178,7 +178,6 @@ class Postertemplate extends BaseShop
|
|||
'data' => [ 255, 255, 255 ]
|
||||
],
|
||||
];
|
||||
|
||||
$fontRate = 0.725; // 20px 等于 14.5磅,换算比率 1px = 0.725磅
|
||||
$option = [
|
||||
[
|
||||
|
|
@ -240,13 +239,19 @@ class Postertemplate extends BaseShop
|
|||
],
|
||||
];
|
||||
|
||||
list($width, $height, $type, $attr) = getimagesize(img($poster_data[ 'data' ][ 'background' ]));
|
||||
|
||||
|
||||
|
||||
// var_dump(img($poster_data[ 'data' ][ 'background' ]));die;
|
||||
|
||||
list($width, $height, $type, $attr) = getimagesize($poster_data[ 'data' ][ 'background' ]);
|
||||
$height = 720 * $height / $width;
|
||||
$back_ground = [
|
||||
[
|
||||
'action' => 'imageCopy', // 写入背景图
|
||||
'data' => [
|
||||
img($poster_data[ 'data' ][ 'background' ]),
|
||||
$poster_data[ 'data' ][ 'background' ],
|
||||
// img($poster_data[ 'data' ][ 'background' ]),
|
||||
0,
|
||||
0,
|
||||
720,
|
||||
|
|
@ -260,6 +265,8 @@ class Postertemplate extends BaseShop
|
|||
$option = array_merge($ground, $back_ground, $option, $member_option);
|
||||
$option_res = $poster->create($option);
|
||||
|
||||
// var_dump($option_res);die;
|
||||
|
||||
if (is_array($option_res)) return $option_res;
|
||||
$pic_name = rand(10000, 99999);
|
||||
$res = $option_res->jpeg('upload/poster/goods', 'fenxiao' . $pic_name);
|
||||
|
|
|
|||
|
|
@ -1,10 +1,10 @@
|
|||
<?php
|
||||
/**
|
||||
* ThinkShop商城系统 - 团队十年电商经验汇集巨献!
|
||||
* B2B商城系统 - 团队十年电商经验汇集巨献!
|
||||
* =========================================================
|
||||
* Copy right 2019-2029 成都云之牛科技有限公司, 保留所有权利。
|
||||
* Copy right 2023-2046 四川正今科技有限公司, 保留所有权利。
|
||||
* ----------------------------------------------
|
||||
* 官方网址: https://www.cdcloudshop.com
|
||||
* 官方网址: https://www.viewsphp.com
|
||||
* =========================================================
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -1,135 +0,0 @@
|
|||
{extend name="app/shop/view/base.html"/}
|
||||
{block name="resources"}
|
||||
<style>
|
||||
.ns-form {margin-top: 0;}
|
||||
.coupon-box{
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.coupon-box .layui-form{
|
||||
padding: 0!important;
|
||||
}
|
||||
|
||||
.layui-layer-page .layui-layer-content{
|
||||
overflow: auto !important;
|
||||
}
|
||||
|
||||
.ns-del-btn {
|
||||
cursor: pointer;
|
||||
}
|
||||
.ns-level-equity .layui-input {
|
||||
display: inline-block;
|
||||
}
|
||||
.gods-box table:first-of-type{
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.gods-box table:last-of-type{
|
||||
margin-top: 0;
|
||||
display: block;
|
||||
max-height: 323px;
|
||||
overflow: auto;
|
||||
}
|
||||
.coupon-box .ns-single-filter-box{
|
||||
padding-top: 0;
|
||||
}
|
||||
.align-center{
|
||||
text-align: center!important;
|
||||
}
|
||||
</style>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<div class="layui-form">
|
||||
<div class="layui-card ns-card-common ns-card-brief">
|
||||
<div class="layui-card-header">
|
||||
<span class="ns-card-title">基础信息</span>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><span class="required">*</span>等级名称:</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="level_name" type="text" lay-verify="required" class="layui-input ns-len-long">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><span class="required">*</span>赠送比例:</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="flower_multiple" type="text" lay-verify="required" class="layui-input ns-len-long">
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="layui-form-item">-->
|
||||
<!-- <label class="layui-form-label"><span class="required">*</span>代理商购茶赠送茶花倍数:</label>-->
|
||||
<!-- <div class="layui-input-block">-->
|
||||
<!-- <input name="flower_times" type="text" lay-verify="required" class="layui-input ns-len-long">-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><span class="required">*</span>代理类型:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="type" value="province" title="省级代理" />
|
||||
<input type="radio" name="type" value="city" title="城市代理"/>
|
||||
<input type="radio" name="type" value="district" title="区域代理"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">等级说明:</label>
|
||||
<div class="layui-input-block ns-len-long">
|
||||
<textarea name="remark" class="layui-textarea"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-card ns-card-common">
|
||||
<div class="layui-card-body">
|
||||
<div class="ns-form-row">
|
||||
<button class="layui-btn ns-bg-color" lay-submit lay-filter="save">保存</button>
|
||||
<button class="layui-btn layui-btn-primary" onclick="back()">返回</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{block name="script"}
|
||||
<script>
|
||||
var coupon_id = [];
|
||||
var form;
|
||||
layui.use(['form', 'laytpl'], function() {
|
||||
form = layui.form;
|
||||
var repeat_flag = false; //防重复标识
|
||||
form.render();
|
||||
/**
|
||||
* 监听保存
|
||||
*/
|
||||
form.on('submit(save)', function(data) {
|
||||
if (repeat_flag) return false;
|
||||
repeat_flag = true;
|
||||
$.ajax({
|
||||
url: ns.url("fenxiao://shop/agentlevel/add"),
|
||||
data: data.field,
|
||||
dataType: 'JSON', //服务器返回json格式数据
|
||||
type: 'POST', //http请求类型
|
||||
success: function(res) {
|
||||
repeat_flag = false;
|
||||
if (res.code == 0) {
|
||||
layer.confirm('添加成功', {
|
||||
title:'操作提示',
|
||||
btn: ['返回列表', '继续添加'],
|
||||
closeBtn: 0,
|
||||
yes: function(){
|
||||
location.href = ns.url("fenxiao://shop/agentlevel/lists")
|
||||
},
|
||||
btn2: function() {
|
||||
location.href = ns.url("fenxiao://shop/agentlevel/add")
|
||||
}
|
||||
});
|
||||
}else{
|
||||
layer.msg(res.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
function back(){
|
||||
location.href = ns.url("member://shop/memberlevel/levellist");
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
|
|
@ -1,113 +0,0 @@
|
|||
{extend name="app/shop/view/base.html"/}
|
||||
{block name="resources"}
|
||||
<style>
|
||||
.ns-form {margin-top: 0;}
|
||||
.layui-layer-page .layui-layer-content{
|
||||
overflow: auto !important;
|
||||
}
|
||||
.ns-level-equity .layui-input {
|
||||
display: inline-block;
|
||||
}
|
||||
.gods-box table:first-of-type{
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.gods-box table:last-of-type{
|
||||
margin-top: 0;
|
||||
display: block;
|
||||
max-height: 323px;
|
||||
overflow: auto;
|
||||
}
|
||||
.coupon-box .ns-single-filter-box{
|
||||
padding-top: 0;
|
||||
}
|
||||
.align-center{
|
||||
text-align: center!important;
|
||||
}
|
||||
</style>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<div class="layui-form">
|
||||
<div class="layui-card ns-card-common ns-card-brief">
|
||||
<div class="layui-card-header">
|
||||
<span class="ns-card-title">基础信息</span>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><span class="required">*</span>等级名称:</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="level_name" type="text" lay-verify="required" value="{$info.level_name}" class="layui-input ns-len-long">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><span class="required">*</span>赠送比例:</label>
|
||||
<div class="layui-input-block">
|
||||
<input name="flower_multiple" type="text" lay-verify="required" value="{$info.flower_multiple}" class="layui-input ns-len-long">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="layui-form-item">-->
|
||||
<!-- <label class="layui-form-label"><span class="required">*</span>代理商购茶赠送茶花倍数:</label>-->
|
||||
<!-- <div class="layui-input-block">-->
|
||||
<!-- <input name="flower_times" type="text" lay-verify="required" value="{$info.flower_times}" class="layui-input ns-len-long">-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><span class="required">*</span>代理类型:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="radio" name="type" value="province" title="省级代理" {if $info.type == 'province'} checked {/if}/>
|
||||
<input type="radio" name="type" value="city" title="城市代理" {if $info.type == 'city'} checked {/if}/>
|
||||
<input type="radio" name="type" value="district" title="区域代理" {if $info.type == 'district'} checked {/if}/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">等级说明:</label>
|
||||
<div class="layui-input-block ns-len-long">
|
||||
<textarea name="remark" class="layui-textarea">{$info.remark}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-card ns-card-common">
|
||||
<div class="layui-card-body">
|
||||
<div class="ns-form-row">
|
||||
<button class="layui-btn ns-bg-color" lay-submit lay-filter="save">保存</button>
|
||||
<button class="layui-btn layui-btn-primary" onclick="back()">返回</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{block name="script"}
|
||||
<script>
|
||||
var coupon_id = [];
|
||||
var form;
|
||||
layui.use(['form', 'laytpl'], function() {
|
||||
form = layui.form;
|
||||
var repeat_flag = false; //防重复标识
|
||||
form.render();
|
||||
/**
|
||||
* 监听保存
|
||||
*/
|
||||
form.on('submit(save)', function(data) {
|
||||
if (repeat_flag) return false;
|
||||
repeat_flag = true;
|
||||
$.ajax({
|
||||
url: location.href,
|
||||
data: data.field,
|
||||
dataType: 'JSON', //服务器返回json格式数据
|
||||
type: 'POST', //http请求类型
|
||||
success: function(res) {
|
||||
repeat_flag = false;
|
||||
layer.msg(res.message);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
function back(){
|
||||
location.href = ns.url("fenxiao://shop/agentlevel/lists");
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
|
|
@ -1,212 +0,0 @@
|
|||
{extend name="app/shop/view/base.html"/}
|
||||
{block name="resources"}
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<div class="layui-collapse ns-tips">
|
||||
<div class="layui-colla-item">
|
||||
<h2 class="layui-colla-title">操作提示</h2>
|
||||
<ul class="layui-colla-content layui-show">
|
||||
<li>根据不同等级转换茶花比例</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ns-single-filter-box">
|
||||
<button class="layui-btn ns-bg-color" onclick="clickAdd()">添加等级</button>
|
||||
</div>
|
||||
<!-- 列表 -->
|
||||
<table id="level_list" lay-filter="level_list"></table>
|
||||
|
||||
<!-- 状态 -->
|
||||
<script type="text/html" id="status">
|
||||
{{# if(d.status == 0){ }}
|
||||
停用
|
||||
{{# }else if(d.status == 1){ }}
|
||||
启用
|
||||
{{# } }}
|
||||
</script>
|
||||
|
||||
<!-- 操作 -->
|
||||
<script type="text/html" id="operation">
|
||||
<div class="ns-table-btn">
|
||||
<a class="layui-btn" lay-event="edit">编辑</a>
|
||||
<a class="layui-btn" lay-event="del">删除</a>
|
||||
</div>
|
||||
</script>
|
||||
{/block}
|
||||
|
||||
{block name="script"}
|
||||
<script>
|
||||
layui.use('form', function() {
|
||||
var table,
|
||||
repeat_flag = false; //防重复标识
|
||||
table = new Table({
|
||||
elem: '#level_list',
|
||||
url: ns.url("fenxiao://shop/agentlevel/lists"),
|
||||
cols: [
|
||||
[
|
||||
{
|
||||
field: 'level_name',
|
||||
title: '等级名称',
|
||||
unresize: 'false',
|
||||
width: '10%'
|
||||
},
|
||||
{
|
||||
field: 'flower_multiple',
|
||||
title: '赠送比例',
|
||||
unresize: 'false',
|
||||
width: '10%',
|
||||
templet: function(data) {
|
||||
return data.flower_multiple + '%';
|
||||
}
|
||||
},
|
||||
// {
|
||||
// field: 'flower_times',
|
||||
// title: '代理商购茶赠送茶花倍数',
|
||||
// unresize: 'false',
|
||||
// width: '20%',
|
||||
// templet: function(data) {
|
||||
// return data.flower_times;
|
||||
// }
|
||||
// },
|
||||
{
|
||||
field: 'type',
|
||||
title: '代理类型',
|
||||
unresize: 'false',
|
||||
width: '10%',
|
||||
templet: function(data) {
|
||||
let text='';
|
||||
switch (data.type){
|
||||
case 'province':
|
||||
text='省级代理';
|
||||
break;
|
||||
case 'city':
|
||||
text='城市代理';
|
||||
break;
|
||||
case 'district':
|
||||
text='区域代理';
|
||||
break;
|
||||
}
|
||||
return text;
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '操作',
|
||||
toolbar: '#operation',
|
||||
unresize: 'false',
|
||||
width: '10%'
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
/**
|
||||
* 监听工具栏操作
|
||||
*/
|
||||
table.tool(function(obj) {
|
||||
var data = obj.data;
|
||||
switch (obj.event) {
|
||||
case 'del': //删除
|
||||
del(data.level_id);
|
||||
break;
|
||||
case 'start': //启用
|
||||
start_status(data.level_id,1);
|
||||
break;
|
||||
case 'stop': //停用
|
||||
stop_status(data.level_id,0);
|
||||
break;
|
||||
case 'edit': //编辑
|
||||
location.href = ns.url("fenxiao://shop/agentlevel/edit", {"level_id": data.level_id});
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* 删除
|
||||
*/
|
||||
function del(level_id){
|
||||
if (repeat_flag) return false;
|
||||
repeat_flag = true;
|
||||
layer.confirm('确定要删除该等级吗?', function() {
|
||||
$.ajax({
|
||||
url: ns.url("fenxiao://shop/agentlevel/delete"),
|
||||
data: {level_id:level_id},
|
||||
dataType: 'JSON',
|
||||
type: 'POST',
|
||||
success: function(res) {
|
||||
layer.msg(res.message);
|
||||
repeat_flag = false;
|
||||
if (res.code == 0) {
|
||||
table.reload();
|
||||
}
|
||||
}
|
||||
});
|
||||
}, function () {
|
||||
layer.close();
|
||||
repeat_flag = false;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 停用
|
||||
*/
|
||||
function stop_status(level_id,type){
|
||||
if (repeat_flag) return false;
|
||||
repeat_flag = true;
|
||||
|
||||
layer.confirm('确定要停用该等级吗?', function() {
|
||||
$.ajax({
|
||||
url: ns.url("fenxiao://shop/agentlevel/status"),
|
||||
data: {level_id:level_id,type:type},
|
||||
dataType: 'JSON',
|
||||
type: 'POST',
|
||||
success: function(res) {
|
||||
layer.msg(res.message);
|
||||
repeat_flag = false;
|
||||
|
||||
if (res.code == 0) {
|
||||
table.reload();
|
||||
}
|
||||
}
|
||||
});
|
||||
}, function () {
|
||||
layer.close();
|
||||
repeat_flag = false;
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 启用
|
||||
*/
|
||||
function start_status(level_id,type){
|
||||
if (repeat_flag) return false;
|
||||
repeat_flag = true;
|
||||
layer.confirm('确定要启用该等级吗?', function() {
|
||||
$.ajax({
|
||||
url: ns.url("fenxiao://shop/agentlevel/status"),
|
||||
data: {level_id:level_id,type:type},
|
||||
dataType: 'JSON',
|
||||
type: 'POST',
|
||||
success: function(res) {
|
||||
layer.msg(res.message);
|
||||
repeat_flag = false;
|
||||
if (res.code == 0) {
|
||||
table.reload();
|
||||
}
|
||||
}
|
||||
});
|
||||
}, function () {
|
||||
layer.close();
|
||||
repeat_flag = false;
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
function clickAdd()
|
||||
{
|
||||
location.href = ns.url('fenxiao://shop/agentlevel/add');
|
||||
}
|
||||
|
||||
</script>
|
||||
{/block}
|
||||
|
|
@ -1,207 +0,0 @@
|
|||
{extend name="app/shop/view/base.html"/}
|
||||
{block name="resources"}
|
||||
<style>
|
||||
.layui-form {
|
||||
position: relative;
|
||||
}
|
||||
.layui-form-label {
|
||||
text-align: right;
|
||||
margin-left: 60px;
|
||||
}
|
||||
.layui-form-item {
|
||||
margin-bottom: 22px;
|
||||
}
|
||||
.fenxiao-select {
|
||||
position: absolute;
|
||||
left: 400px;
|
||||
top: 135px;
|
||||
}
|
||||
.layui-unselect.layui-form-radio.layui-form-radioed i:after {
|
||||
background-color: #fff;
|
||||
}
|
||||
.layui-table-body {
|
||||
max-height: 530px;
|
||||
}
|
||||
.member-select {
|
||||
position: absolute;
|
||||
left: 400px;
|
||||
top: 195px;
|
||||
}
|
||||
.fenxiao-header {
|
||||
padding: 50px 0 100px 50px;
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
}
|
||||
</style>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<div class="layui-form ns-form">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><span class="required">*</span>代理等级:</label>
|
||||
<div class="layui-input-inline ns-len-mid">
|
||||
<select name="level_id" lay-verify="required" lay-filter="level_id" id="level_id">
|
||||
<option value="">请选择</option>
|
||||
{volist name="$level_list" id="level"}
|
||||
<option value="{$level.level_id}">{$level.level_name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"><span class="required">*</span>区域设置:</label>
|
||||
<div class="layui-input-inline ns-len-mid area-select">
|
||||
<select name="province_id" lay-filter="province_id" lay-verify="province_id">
|
||||
<option value="">请选择省份</option>
|
||||
{foreach $province_list as $k => $v}
|
||||
<option value="{$v.id}">{$v.name}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
<div class="layui-input-inline ns-len-mid area-select">
|
||||
<select name="city_id" lay-filter="city_id" lay-verify="city_id">
|
||||
<option value="">请选择城市</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="layui-input-inline ns-len-mid area-select">
|
||||
<select name="district_id" lay-filter="district_id" lay-verify="district_id">
|
||||
<option value="">请选择区/县</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">管理分销商:</label>
|
||||
<button class="layui-btn layui-btn1 ns-bg-color" onclick="addFenxiao()">选择分销商</button>
|
||||
</div>
|
||||
<div class="fenxiao-select"></div>
|
||||
<div class="ns-form-row">
|
||||
<button class="layui-btn ns-bg-color" lay-submit lay-filter="save">保存</button>
|
||||
<button class="layui-btn layui-btn-primary" onclick="back()">返回</button>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{block name="script"}
|
||||
<script type="text/html" id="addFenxiao">
|
||||
<div class="layui-form">
|
||||
<div class="layui-input-inline" style="width: 205px;">
|
||||
<input type="text" style="width: 205px;" name="fenxiao_search" placeholder="请输入分销商名称" autocomplete="off" class="layui-input ">
|
||||
<button type="button" class="layui-btn layui-btn-primary fenxiao-search" style="height: 32px; line-height: 32px; position: absolute; right: 1px; top: 1px; border-width: 0; border-left-width: 1px;" lay-filter="search" lay-submit>
|
||||
<i class="layui-icon"></i>
|
||||
</button>
|
||||
</div>
|
||||
<table id="fenxiao_list" lay-filter="fenxiao_list"></table>
|
||||
</div>
|
||||
</script>
|
||||
<script type="text/javascript" src="SHOP_JS/address.js"></script>
|
||||
<script type="text/javascript">
|
||||
var new_fenxiao_id = 0,agent_level_name='';
|
||||
layui.use(['form', 'laytpl','table','laypage'], function() {
|
||||
laytpl = layui.laytpl;
|
||||
form = layui.form;
|
||||
laypage = layui.laypage;
|
||||
table = layui.table;
|
||||
repeat_flag = false;
|
||||
form.render();
|
||||
/**
|
||||
* 监听提交
|
||||
*/
|
||||
form.on('submit(save)', function(data) {
|
||||
data.field.fenxiao_id = new_fenxiao_id;
|
||||
data.field.agent_level_name = agent_level_name;
|
||||
console.log(data);
|
||||
$.ajax({
|
||||
url: ns.url("fenxiao://shop/area/add"),
|
||||
data: data.field,
|
||||
dataType: 'JSON', //服务器返回json格式数据
|
||||
type: 'POST', //HTTP请求类型
|
||||
success: function(res) {
|
||||
repeat_flag = false;
|
||||
if (res.code == 0) {
|
||||
layer.msg(res.message);
|
||||
location.href = ns.url("fenxiao://shop/area/lists")
|
||||
} else {
|
||||
layer.msg(res.message);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
form.on('select(level_id)', function(data){
|
||||
var e = data.elem;
|
||||
agent_level_name =e[e.selectedIndex].text;
|
||||
});
|
||||
});
|
||||
function addFenxiao() {
|
||||
var add_attr = $("#addFenxiao").html();
|
||||
form.on('radio(layfenxiaoid)', function(obj){
|
||||
new_fenxiao_id = obj.value;
|
||||
var title2 = ($(this).data('index'))
|
||||
console.log(title2);
|
||||
$('.layui-btn1').parents('.layui-form-item').next('.fenxiao-select').html(title2)
|
||||
});
|
||||
laytpl(add_attr).render({}, function(html) {
|
||||
add_attr_index = layer.open({
|
||||
title: '选择分销商',
|
||||
skin: 'layer-tips-class',
|
||||
type: 1,
|
||||
area: ['1000px', '800px'],
|
||||
content: html,
|
||||
btn:["保存","返回"],
|
||||
yes: function(){
|
||||
layer.close(add_attr_index);
|
||||
}
|
||||
});
|
||||
});
|
||||
//展示已知数据
|
||||
table = new Table({
|
||||
elem: '#fenxiao_list',
|
||||
url: ns.url("fenxiao://shop/area/getfenxiaolist"),
|
||||
cols: [
|
||||
[{
|
||||
width: "12%",
|
||||
title: '商户选择',
|
||||
unresize: 'false',
|
||||
templet: function(data) {
|
||||
var html = '';
|
||||
html += `
|
||||
<div>
|
||||
<input type="radio" name="layTableRadioc" value="${data.fenxiao_id}" data-index="${data.fenxiao_name}" lay-type="layTableRadio" lay-filter="layfenxiaoid">
|
||||
</div>
|
||||
`;
|
||||
return html;
|
||||
}
|
||||
},{
|
||||
title: '分销商名称',
|
||||
width: '50%',
|
||||
unresize: 'false',
|
||||
field: 'fenxiao_name',
|
||||
}, {
|
||||
field: 'account',
|
||||
title: '佣金',
|
||||
unresize: 'false',
|
||||
width: '30%',
|
||||
},
|
||||
]
|
||||
],
|
||||
});
|
||||
/**
|
||||
* 搜索功能
|
||||
*/
|
||||
form.on('submit(search)', function (data) {
|
||||
table.reload({
|
||||
page: {
|
||||
curr: 1
|
||||
},
|
||||
where: data.field
|
||||
});
|
||||
});
|
||||
$(document).keydown(function (event) {
|
||||
if (event.keyCode == 13) {
|
||||
$(".fenxiao-search").trigger("click");
|
||||
}
|
||||
});
|
||||
}
|
||||
function back() {
|
||||
location.href = ns.url("fenxiao://shop/area/lists");
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
|
|
@ -1,285 +0,0 @@
|
|||
{extend name="app/shop/view/base.html"/}
|
||||
{block name="resources"}
|
||||
<style>
|
||||
.ns-screen {
|
||||
margin-top: 15px;
|
||||
}
|
||||
</style>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<div class="layui-collapse ns-tips">
|
||||
<div class="layui-colla-item">
|
||||
<h2 class="layui-colla-title">操作提示</h2>
|
||||
<ul class="layui-colla-content layui-show">
|
||||
<li>点击查看按钮可以查看分销商信息、订单信息、账户明细。</li>
|
||||
<li>点击冻结按钮可以取消其分销商资格</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ns-single-filter-box">
|
||||
<button class="layui-btn ns-bg-color" onclick="clickAdd()">添加代理</button>
|
||||
</div>
|
||||
<div class="ns-screen layui-collapse" lay-filter="selection_panel">
|
||||
<div class="layui-colla-item">
|
||||
<h2 class="layui-colla-title"></h2>
|
||||
<form class="layui-colla-content layui-form layui-show">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">账号</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="search_text_type">
|
||||
<option value="fenxiao_name">分销商名称</option>
|
||||
<option value="mobile">手机号</option>
|
||||
<option value="member_id">会员ID</option>
|
||||
<option value="nickname">会员昵称</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" id="search_text" name="search_text" placeholder="分销商名称/手机号/会员ID" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">上级分销商:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="parent_name" placeholder="请输入上级分销商" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">代理等级:</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="level_id" lay-filter="level_id">
|
||||
<option value="">全部</option>
|
||||
{volist name="$level_list" id="level"}
|
||||
<option value="{$level.level_id}">{$level.level_name}</option>
|
||||
{/volist}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">添加时间:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" class="layui-input" name="start_time" id="start_time" autocomplete="off" placeholder="开始时间" readonly>
|
||||
<i class="ns-calendar"></i>
|
||||
</div>
|
||||
<div class="layui-form-mid">-</div>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" class="layui-input" name="end_time" id="end_time" autocomplete="off" placeholder="结束时间" readonly>
|
||||
<i class="ns-calendar"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ns-form-row">
|
||||
<button class="layui-btn ns-bg-color" lay-submit lay-filter="search">筛选</button>
|
||||
<button type="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 列表 -->
|
||||
<table id="fenxiao_list" lay-filter="fenxiao_list"></table>
|
||||
|
||||
<!-- 用户信息 -->
|
||||
<script type="text/html" id="account">
|
||||
<div class="layui-elip">当前佣金:{{d.account}}</div>
|
||||
<div class="layui-elip">已提现佣金:{{d.account_withdraw}}</div>
|
||||
<div class="layui-elip">区业绩:{{'大:'+ d.max_order_money + '小:'+d.min_order_money}}</div>
|
||||
<div class="layui-elip">团队人数:{{d.total_member_count}}</div>
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="Flower_fruit">
|
||||
<div class="layui-elip">茶花:{{d.flower_num}}</div>
|
||||
<div class="layui-elip">茶果:{{d.fruit_num}}</div>
|
||||
</script>
|
||||
<!-- 会员信息 -->
|
||||
<script type="text/html" id="username">
|
||||
<a href="javascript:memberDetail({{ d.member_id }});">{{ d.username }}</a>
|
||||
</script>
|
||||
|
||||
<!-- 状态 -->
|
||||
<script type="text/html" id="status">
|
||||
{{# if(d.status == 1){ }}
|
||||
<span style="color: green;">正常</span>
|
||||
{{# }else if(d.status == -1){ }}
|
||||
<span style="color: gray;">冻结</span>
|
||||
{{# } }}
|
||||
</script>
|
||||
|
||||
<!-- 工具栏操作 -->
|
||||
<script type="text/html" id="operation">
|
||||
<div class="ns-table-btn">
|
||||
<a class="layui-btn" lay-event="detail">查看</a>
|
||||
|
||||
<a class="layui-btn" lay-event="remove">移除代理</a>
|
||||
|
||||
</div>
|
||||
</script>
|
||||
{/block}
|
||||
|
||||
{block name="script"}
|
||||
<script>
|
||||
var table,form,laydate;
|
||||
layui.use(['form', 'laydate'], function() {
|
||||
form = layui.form;
|
||||
laydate = layui.laydate;
|
||||
form.render();
|
||||
|
||||
//渲染时间
|
||||
laydate.render({
|
||||
elem: '#start_time',
|
||||
type: 'datetime'
|
||||
});
|
||||
|
||||
laydate.render({
|
||||
elem: '#end_time',
|
||||
type: 'datetime'
|
||||
});
|
||||
|
||||
table = new Table({
|
||||
elem: '#fenxiao_list',
|
||||
url: ns.url("fenxiao://shop/area/lists"),
|
||||
cols: [
|
||||
[{
|
||||
field: 'fenxiao_name',
|
||||
title: '代理名称',
|
||||
unresize: 'false',
|
||||
width: '8%'
|
||||
},{
|
||||
templet: function(data) {
|
||||
var html = ""
|
||||
html += `会员账号:<span title="${data.username}">${data.username}</span><br/>
|
||||
会员昵称:<span title="${data.nickname}">${data.nickname}</span><br/>
|
||||
手机号码:<span title="${data.member_mobile}">${data.member_mobile}</span>`;
|
||||
return html;
|
||||
},
|
||||
title: '会员信息',
|
||||
unresize: 'false',
|
||||
width: '12%'
|
||||
}, {
|
||||
field: 'parent_name',
|
||||
title: '推荐人',
|
||||
unresize: 'false',
|
||||
width: '5%',
|
||||
templet: function(data) {
|
||||
if(data.parent_name){
|
||||
return data.parent_name;
|
||||
}else{
|
||||
return '无';
|
||||
}
|
||||
}
|
||||
}, {
|
||||
field: 'agent_level_name',
|
||||
title: '代理等级',
|
||||
unresize: 'false',
|
||||
width: '10%'
|
||||
},
|
||||
// {
|
||||
// field: 'total_order_money',
|
||||
// title: '总业绩',
|
||||
// width:'8%',
|
||||
// unresize: 'false',
|
||||
// },
|
||||
// {
|
||||
// title: '佣金账户',
|
||||
// width:'10%',
|
||||
// unresize: 'false',
|
||||
// templet: '#account'
|
||||
// },
|
||||
// {
|
||||
// title: '茶花&果',
|
||||
// width:'10%',
|
||||
// unresize: 'false',
|
||||
// templet: '#Flower_fruit'
|
||||
// }
|
||||
// , {
|
||||
//
|
||||
// title: '直推',
|
||||
// unresize: 'false',
|
||||
// width: '5%',
|
||||
// templet: function(data){
|
||||
// return data.team_num;
|
||||
// }
|
||||
// },
|
||||
{
|
||||
field: 'status',
|
||||
title: '状态',
|
||||
templet: '#status',
|
||||
unresize: 'false',
|
||||
width: '5%'
|
||||
},
|
||||
{
|
||||
field: 'create_time',
|
||||
title: '添加时间',
|
||||
unresize: 'false',
|
||||
width: '10%',
|
||||
templet: function(data) {
|
||||
return ns.time_to_date(data.create_time);
|
||||
}
|
||||
}, {
|
||||
title: '操作',
|
||||
toolbar: '#operation',
|
||||
unresize: 'false',
|
||||
width: '10%'
|
||||
}]
|
||||
]
|
||||
});
|
||||
|
||||
/**
|
||||
* 搜索功能
|
||||
*/
|
||||
form.on('submit(search)', function(data) {
|
||||
table.reload({
|
||||
page: {
|
||||
curr: 1
|
||||
},
|
||||
where: data.field
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
/**
|
||||
* 监听工具栏操作
|
||||
*/
|
||||
table.tool(function(obj) {
|
||||
var data = obj.data,
|
||||
event = obj.event;
|
||||
switch (event) {
|
||||
case 'detail': //查看
|
||||
location.href = ns.url('fenxiao://shop/fenxiao/detail', {'fenxiao_id': data.fenxiao_id})
|
||||
break;
|
||||
case 'remove': //冻结
|
||||
layer.confirm('确定要移除该账户吗?', function () {
|
||||
if (repeat_flag) return;
|
||||
repeat_flag = true;
|
||||
$.ajax({
|
||||
url: ns.url("fenxiao://shop/area/remove"),
|
||||
data: {id:data.id},
|
||||
dataType: 'JSON',
|
||||
type: 'POST',
|
||||
success: function(res) {
|
||||
layer.msg(res.message);
|
||||
repeat_flag = false;
|
||||
if (res.code == 0) {
|
||||
table.reload();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
break;
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
function clickAdd()
|
||||
{
|
||||
location.href = ns.url('fenxiao://shop/area/add');
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
|
|
@ -1,8 +1,5 @@
|
|||
{extend name="app/shop/view/base.html"/}
|
||||
{block name="resources"}
|
||||
<style>
|
||||
.form-wrap {margin-top: 0;}
|
||||
</style>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<div class="layui-form form-wrap">
|
||||
|
|
@ -16,78 +13,79 @@
|
|||
<label class="layui-form-label">显示申请协议:</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-input-inline">
|
||||
<input type="radio" name="is_agreement" value="1" lay-filter="level" title="显示" {if $agreement_info.is_agreement == 1} checked {/if}/>
|
||||
<input type="radio" name="is_agreement" value="0" lay-filter="level" title="隐藏" {if $agreement_info.is_agreement != 1} checked {/if}/>
|
||||
<input type="radio" name="is_agreement" value="1" lay-filter="level" title="显示" {if
|
||||
$agreement_info.is_agreement== 1} checked {/if}/>
|
||||
<input type="radio" name="is_agreement" value="0" lay-filter="level" title="隐藏" {if
|
||||
$agreement_info.is_agreement !=1} checked {/if}/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item apply_img">
|
||||
<label class="layui-form-label">申请页面顶部图片:</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="upload-img-block">
|
||||
<div class="upload-img-box {notempty name="$agreement_info['img']"}hover{/notempty}">
|
||||
<div class="upload-default" id="applyImg">
|
||||
<div class="upload-img-box {notempty name=" $agreement_info['img']"}hover{/notempty}">
|
||||
<div class="upload-default" id="applyImg">
|
||||
{if condition="$agreement_info.img"}
|
||||
<div id="preview_imgUpload" class="preview_img">
|
||||
<img layer-src src="{:img($agreement_info.img)}" class="img_prev"/>
|
||||
</div>
|
||||
<div id="preview_imgUpload" class="preview_img">
|
||||
<img layer-src src="{:img($agreement_info.img)}" class="img_prev"/>
|
||||
</div>
|
||||
{else/}
|
||||
<div class="upload">
|
||||
<i class="iconfont iconshangchuan"></i>
|
||||
<p>点击上传</p>
|
||||
</div>
|
||||
<div class="upload">
|
||||
<i class="iconfont iconshangchuan"></i>
|
||||
<p>点击上传</p>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="operation">
|
||||
<div>
|
||||
<i title="图片预览" class="iconfont iconreview js-preview" style="margin-right: 20px;"></i>
|
||||
<i title="删除图片" class="layui-icon layui-icon-delete js-delete"></i>
|
||||
</div>
|
||||
<div class="replace_img js-replace">点击替换</div>
|
||||
</div>
|
||||
<input type="hidden" name="img" value="{$agreement_info.img}">
|
||||
</div>
|
||||
<!-- <p id="applyImg" class=" {if condition='$agreement_info.img'} replace {else/} no-replace{/if}">替换</p>
|
||||
<div class="operation">
|
||||
<div>
|
||||
<i title="图片预览" class="iconfont iconreview js-preview" style="margin-right: 20px;"></i>
|
||||
<i title="删除图片" class="layui-icon layui-icon-delete js-delete"></i>
|
||||
</div>
|
||||
<div class="replace_img js-replace">点击替换</div>
|
||||
</div>
|
||||
<input type="hidden" name="img" value="{$agreement_info.img}">
|
||||
<i class="del {if condition="$agreement_info.img"}show{/if}">x</i> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="word-aux">
|
||||
<p>建议尺寸:750*337像素</p>
|
||||
<!-- <p id="applyImg" class=" {if condition='$agreement_info.img'} replace {else/} no-replace{/if}">替换</p>
|
||||
<input type="hidden" name="img" value="{$agreement_info.img}">
|
||||
<i class="del {if condition="$agreement_info.img"}show{/if}">x</i> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="layui-card card-common card-brief">
|
||||
<div class="layui-card-header">
|
||||
<span class="card-title">协议设置</span>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">协议名称:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="agreement_title" value="{$document.title}" lay-verify="required" class="layui-input len-mid new_pass" maxlength="18">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">协议内容:</label>
|
||||
<div class="layui-input-block">
|
||||
<script id="editor" type="text/plain" class="special-length" style="height:600px;"></script>
|
||||
<input type="hidden" name="agreement_content" id="agreement_content" value="{$document.content}" />
|
||||
</div>
|
||||
|
||||
<div class="word-aux">
|
||||
<p>建议尺寸:750*337像素</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<button class="layui-btn" lay-submit lay-filter="save">保存</button>
|
||||
|
||||
<div class="layui-card card-common card-brief">
|
||||
<div class="layui-card-header">
|
||||
<span class="card-title">协议设置</span>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">协议名称:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="agreement_title" value="{$document.title}" lay-verify="required"
|
||||
class="layui-input len-mid new_pass" maxlength="18">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">协议内容:</label>
|
||||
<div class="layui-input-block">
|
||||
<script id="editor" type="text/plain" class="special-length" style="height:600px;"></script>
|
||||
<input type="hidden" name="agreement_content" id="agreement_content" value="{$document.content}"/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-row" style="margin-top:0;padding-left:20px;">
|
||||
<button class="layui-btn" lay-submit lay-filter="save">保存</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{/block}
|
||||
{block name="script"}
|
||||
|
|
@ -97,13 +95,13 @@
|
|||
<script>
|
||||
//实例化富文本
|
||||
var ue = UE.getEditor('editor');
|
||||
if($("#agreement_content").val()){
|
||||
ue.ready(function() {
|
||||
if ($("#agreement_content").val()) {
|
||||
ue.ready(function () {
|
||||
ue.setContent($("#agreement_content").val());
|
||||
});
|
||||
}
|
||||
|
||||
layui.use(['form'], function() {
|
||||
layui.use(['form'], function () {
|
||||
var form = layui.form,
|
||||
repeat_flag = false; //防重复标识
|
||||
form.render();
|
||||
|
|
@ -112,28 +110,28 @@
|
|||
elem: '#applyImg'
|
||||
});
|
||||
|
||||
form.on('submit(save)', function(data) {
|
||||
form.on('submit(save)', function (data) {
|
||||
if (repeat_flag) return;
|
||||
repeat_flag = true;
|
||||
|
||||
var field = data.field;
|
||||
|
||||
// 删除图片
|
||||
if(!field.img) upload.delete();
|
||||
if (!field.img) upload.delete();
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
url: ns.url("fenxiao://shop/config/agreement"),
|
||||
data: {
|
||||
'is_agreement' : field.is_agreement,
|
||||
'agreement_title' : field.agreement_title,
|
||||
'agreement_content' : ue.getContent(),
|
||||
'img' : field.img,
|
||||
'is_agreement': field.is_agreement,
|
||||
'agreement_title': field.agreement_title,
|
||||
'agreement_content': ue.getContent(),
|
||||
'img': field.img,
|
||||
},
|
||||
success: function(res) {
|
||||
success: function (res) {
|
||||
layer.msg(res.message);
|
||||
repeat_flag = false;
|
||||
repeat_flag = false;
|
||||
if (res.code == 0) {
|
||||
location.reload();
|
||||
}
|
||||
|
|
@ -142,6 +140,6 @@
|
|||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
{/block}
|
||||
|
|
@ -1,11 +1,5 @@
|
|||
{extend name="app/shop/view/base.html"/}
|
||||
{block name="resources"}
|
||||
<style>
|
||||
.form-row{margin-top: 0;}
|
||||
.hide{
|
||||
display: none;
|
||||
}
|
||||
</style>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<div class="layui-form form-wrap">
|
||||
|
|
@ -15,142 +9,8 @@
|
|||
<span class="card-title">分销设置</span>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">新用户赠送钻石:</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-input-inline">
|
||||
<input type="number" name="newuser_points" class="layui-input ns-len-mid" value="{$basics_info.newuser_points??0}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="word-aux ">新用户赠送积分</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">下单赠送积分:</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-input-inline">
|
||||
<input type="number" name="order_give_points_ratio" class="layui-input ns-len-mid" value="{$basics_info.order_give_points_ratio??0}" />
|
||||
</div>
|
||||
<div class="layui-form-mid">%</div>
|
||||
</div>
|
||||
<div class="word-aux ">下单赠送积分,得消费额百分比</div>
|
||||
</div>
|
||||
<!--<div class="layui-form-item">
|
||||
<label class="layui-form-label">下单赠送贡献值:</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-input-inline">
|
||||
<input type="number" name="order_give_contribution_ratio" class="layui-input ns-len-mid" value="{$basics_info.order_give_contribution_ratio??0}" />
|
||||
</div>
|
||||
<div class="layui-form-mid">%</div>
|
||||
</div>
|
||||
<div class="word-aux ">下单赠送贡献值,得消费额百分比</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">下单赠送购房券:</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-input-inline">
|
||||
<input type="number" name="order_give_house_purchase_ratio" class="layui-input ns-len-mid" value="{$basics_info.order_give_house_purchase_ratio??0}" />
|
||||
</div>
|
||||
<div class="layui-form-mid">%</div>
|
||||
</div>
|
||||
<div class="word-aux ">下单赠送购房券,得消费额百分比</div>
|
||||
</div>-->
|
||||
<!--<div class="layui-form-item">
|
||||
<label class="layui-form-label">下单A位置得积分:</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-input-inline">
|
||||
<input type="number" name="order_give_a_points_ratio" class="layui-input ns-len-mid" value="{$basics_info.order_give_a_points_ratio??0}" />
|
||||
</div>
|
||||
<div class="layui-form-mid">%</div>
|
||||
</div>
|
||||
<div class="word-aux ">下单分享A位置得积分,得消费额百分比</div>
|
||||
</div>-->
|
||||
<!--<div class="layui-form-item">
|
||||
<label class="layui-form-label">下单A位置得贡献值:</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-input-inline">
|
||||
<input type="number" name="order_give_a_contribution_ratio" class="layui-input ns-len-mid" value="{$basics_info.order_give_a_contribution_ratio??0}" />
|
||||
</div>
|
||||
<div class="layui-form-mid">%</div>
|
||||
</div>
|
||||
<div class="word-aux ">下单分享A位置得贡献值,得消费额百分比</div>
|
||||
</div>-->
|
||||
<!--<div class="layui-form-item">
|
||||
<label class="layui-form-label">下单D位置得积分:</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-input-inline">
|
||||
<input type="number" name="order_give_d_points_ratio" class="layui-input ns-len-mid" value="{$basics_info.order_give_d_points_ratio??0}" />
|
||||
</div>
|
||||
<div class="layui-form-mid">%</div>
|
||||
</div>
|
||||
<div class="word-aux ">下单分享D位置得积分,得消费额百分比</div>
|
||||
</div>-->
|
||||
<!--<div class="layui-form-item">
|
||||
<label class="layui-form-label">下单D位置得贡献值:</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-input-inline">
|
||||
<input type="number" name="order_give_d_contribution_ratio" class="layui-input ns-len-mid" value="{$basics_info.order_give_d_contribution_ratio??0}" />
|
||||
</div>
|
||||
<div class="layui-form-mid">%</div>
|
||||
</div>
|
||||
<div class="word-aux ">下单分享D位置得贡献值,得消费额百分比</div>
|
||||
</div>-->
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">代理申请协议:</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-input-inline">
|
||||
<textarea name="upgrade_agree" style="resize: none;padding: 10px" rows="15" class="len-long">{$basics_info.upgrade_agree ?? ''}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 每日转换设置 -->
|
||||
<div class="layui-card card-common card-brief hide">
|
||||
<div class="layui-card-header">
|
||||
<span class="card-title">每日转换设置</span>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<!--<div class="layui-form-item">
|
||||
<label class="layui-form-label">无贡献值,积分每天定额返:</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-input-inline">
|
||||
<input type="number" name="no_contribution_points_ratio" class="layui-input ns-len-mid" value="{$basics_info.no_contribution_points_ratio??0}" />
|
||||
</div>
|
||||
<div class="layui-form-mid">%</div>
|
||||
</div>
|
||||
<div class="word-aux ">无贡献值,积分每天定额返</div>
|
||||
</div>-->
|
||||
<!--<div class="layui-form-item">
|
||||
<label class="layui-form-label">有贡献值,积分每天定额返:</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-input-inline">
|
||||
<input type="number" name="contribution_points_ratio" class="layui-input ns-len-mid" value="{$basics_info.contribution_points_ratio??0}" />
|
||||
</div>
|
||||
<div class="layui-form-mid">%</div>
|
||||
</div>
|
||||
<div class="word-aux ">有贡献值,积分每天定额返</div>
|
||||
</div>-->
|
||||
<!--<div class="layui-form-item">
|
||||
<label class="layui-form-label">定额返余额占比:</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-input-inline">
|
||||
<input type="number" name="settlement_points_to_balance_money_ratio" class="layui-input ns-len-mid" value="{$basics_info.settlement_points_to_balance_money_ratio??0}" />
|
||||
</div>
|
||||
<div class="layui-form-mid">%</div>
|
||||
</div>
|
||||
<div class="word-aux ">定额返余额占比</div>
|
||||
</div>-->
|
||||
<!--<div class="layui-form-item">
|
||||
<label class="layui-form-label">定额返积分占比:</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-input-inline">
|
||||
<input type="number" name="settlement_points_to_point_ratio" class="layui-input ns-len-mid" value="{$basics_info.settlement_points_to_point_ratio??0}" />
|
||||
</div>
|
||||
<div class="layui-form-mid">%</div>
|
||||
</div>
|
||||
<div class="word-aux ">定额返积分占比</div>
|
||||
</div>-->
|
||||
<div class="layui-form-item" style="display:none">
|
||||
<label class="layui-form-label">是否开启分销:</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-input-inline">
|
||||
|
|
@ -159,7 +19,8 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item distribution-index {if $basics_info.level == 0}layui-hide{/if}" style="display:none">
|
||||
|
||||
<div class="layui-form-item distribution-index {if $basics_info.level == 0}layui-hide{/if}">
|
||||
<label class="layui-form-label">分销层级:</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-input-inline">
|
||||
|
|
@ -168,7 +29,8 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item distribution-index {if $basics_info.level == 0}layui-hide{/if}" style="display:none">
|
||||
|
||||
<div class="layui-form-item distribution-index {if $basics_info.level == 0}layui-hide{/if}">
|
||||
<label class="layui-form-label">是否开启自购分佣:</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-input-inline">
|
||||
|
|
@ -178,7 +40,8 @@
|
|||
</div>
|
||||
<div class="word-aux ">开启自购,分销商购买自身获得一级佣金<br/>关闭自购,分销商的上级分销商获得一级佣金,自身不再返佣</div>
|
||||
</div>
|
||||
<div class="layui-form-item distribution-index {if $basics_info.level == 0}layui-hide{/if}" style="display:none">
|
||||
|
||||
<div class="layui-form-item distribution-index {if $basics_info.level == 0}layui-hide{/if}">
|
||||
<label class="layui-form-label">是否展示商品详情一级佣金:</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-input-inline">
|
||||
|
|
@ -189,8 +52,10 @@
|
|||
<div class="word-aux ">开启后,商品详情显示,关闭后,商品详情不显示</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="layui-card card-common card-brief distribution-index {if $basics_info.level == 0}layui-hide{/if}" style="display:none">
|
||||
|
||||
<div class="layui-card card-common card-brief distribution-index {if $basics_info.level == 0}layui-hide{/if}">
|
||||
<div class="layui-card-header">
|
||||
<span class="card-title">上下线关系</span>
|
||||
</div>
|
||||
|
|
@ -208,7 +73,8 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-card card-common card-brief distribution-index {if $basics_info.level == 0}layui-hide{/if}" style="display:none">
|
||||
|
||||
<div class="layui-card card-common card-brief distribution-index {if $basics_info.level == 0}layui-hide{/if}">
|
||||
<div class="layui-card-header">
|
||||
<span class="card-title">分销商资格</span>
|
||||
</div>
|
||||
|
|
@ -295,7 +161,8 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-card card-common card-brief distribution-index {if $basics_info.level == 0}layui-hide{/if}" style="display:none">
|
||||
|
||||
<div class="layui-card card-common card-brief distribution-index {if $basics_info.level == 0}layui-hide{/if}">
|
||||
<div class="layui-card-header">
|
||||
<span class="card-title">默认分销佣金比率</span>
|
||||
</div>
|
||||
|
|
@ -338,19 +205,35 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-card card-common card-brief">
|
||||
<div class="layui-card-header">
|
||||
<span class="card-title">代理复制协议</span>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">代理申请协议:</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-input-inline">
|
||||
<textarea name="upgrade_agree" style="resize: none;padding: 10px" rows="15" class="len-long">{$basics_info.upgrade_agree ?? ''}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<div class="form-row" style="margin-top:0;padding-left:20px;">
|
||||
<button class="layui-btn" lay-submit lay-filter="save">保存</button>
|
||||
</div>
|
||||
<!-- 操作 -->
|
||||
<script type="text/html" id="operation">
|
||||
<div class="table-btn">
|
||||
<a class="layui-btn" onclick="delGoods({{d.goods_id}})">删除</a>
|
||||
</div>
|
||||
</script>
|
||||
<div class="layui-card card-common card-brief" style="margin-top: 0;">
|
||||
<div class="layui-card-body" style="padding-top: 0;">
|
||||
<div class="form-row">
|
||||
<button class="layui-btn" lay-submit lay-filter="save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
{/block}
|
||||
{block name="script"}
|
||||
|
|
|
|||
|
|
@ -1,8 +1,5 @@
|
|||
{extend name="app/shop/view/base.html"/}
|
||||
{block name="resources"}
|
||||
<style>
|
||||
.form-wrap {margin-top: 0;}
|
||||
</style>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<div class="layui-form form-wrap">
|
||||
|
|
@ -18,12 +15,12 @@
|
|||
<input type="hidden" name="content" id="content" value="{$document.content}" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<button class="layui-btn" lay-submit lay-filter="save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<button class="layui-btn" lay-submit lay-filter="save">保存</button>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{block name="script"}
|
||||
|
|
@ -50,11 +47,6 @@
|
|||
if (repeat_flag) return;
|
||||
repeat_flag = true;
|
||||
|
||||
var field = data.field;
|
||||
|
||||
// 删除图片
|
||||
if(!field.img) upload.delete();
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
</div>
|
||||
<div class="layui-form-mid">%</div>
|
||||
</div>
|
||||
<div class="word-aux">比率必须为0-100的整数,提现到余额时没有手续费</div>
|
||||
<div class="word-aux">比率必须为0-100的数且保留两位小数,提现到余额时没有手续费</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
|
|
@ -83,6 +83,7 @@
|
|||
layui.use(['form'], function() {
|
||||
var form = layui.form,
|
||||
repeat_flag = false; //防重复标识
|
||||
form.render();
|
||||
|
||||
form.on('submit(save)', function(data) {
|
||||
|
||||
|
|
@ -116,8 +117,14 @@
|
|||
}
|
||||
},
|
||||
positivEinteger: function(value){
|
||||
if(!new RegExp("(^[1-9]\\d*$)").test(value)){
|
||||
return '请输入大于0的正整数';
|
||||
if (parseFloat(value) < 0 || parseFloat(value) > 100) {
|
||||
return '请输入0-100之间的数';
|
||||
}
|
||||
if (value.split(".").length > 1) {
|
||||
let len = value.split(".")[1].length;
|
||||
if (len > 2) {
|
||||
return '门店抽成比率最多两位小数';
|
||||
}
|
||||
}
|
||||
},
|
||||
growthMinInteger: function (value) {
|
||||
|
|
@ -139,21 +146,5 @@
|
|||
});
|
||||
|
||||
});
|
||||
|
||||
function checkInput(obj, type){
|
||||
// if(type == 'withdraw'){
|
||||
// $(obj).val(Math.abs($(obj).val()));
|
||||
// }
|
||||
// if(type == 'withdraw_rate'){
|
||||
// let val = $(obj).val() > 100 ? 100 : $(obj).val() < -100 ? 0 : Math.abs($(obj).val());
|
||||
// $(obj).val(val);
|
||||
// }
|
||||
// if(type == 'min_no_fee'){
|
||||
// $(obj).val(Math.abs($(obj).val()));
|
||||
// }
|
||||
// if(type == 'max_no_fee'){
|
||||
// $(obj).val(Math.abs($(obj).val()));
|
||||
// }
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
|
|
@ -1,8 +1,5 @@
|
|||
{extend name="app/shop/view/base.html"/}
|
||||
{block name="resources"}
|
||||
<style>
|
||||
.layui-layout-admin.admin-style-2 .layui-body .layui-tab + .body-content {padding-top: 63px !important;}
|
||||
</style>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<div class="layui-form form-wrap">
|
||||
|
|
|
|||
|
|
@ -1,207 +0,0 @@
|
|||
{extend name="app/shop/view/base.html"/}
|
||||
{block name="resources"}
|
||||
<style>
|
||||
/* 提示弹出框 */
|
||||
.card-common:first-of-type{margin-top: 0;}
|
||||
.layui-card-body{display: flex;padding-bottom: 0 !important;padding-right: 50px !important;padding-left: 50px !important;flex-wrap: wrap;}
|
||||
.layui-card-body .content{width: 50%;display: flex;flex-direction: column;margin-bottom: 30px;justify-content: center;}
|
||||
.layui-card-body .content .title{color: #909399;font-size: 14px;}
|
||||
.layui-card-body .money{color: #303133;font-size: 26px;margin-top: 10px;max-width: 250px;}
|
||||
.layui-card-body .bottom-title{color: #909399;font-size: 14px;margin-top: 5px;}
|
||||
.layui-laydate-content tr{border: none;}
|
||||
.layui-table-body .layui-none{height: 56px;line-height: 56px;padding: 0;}
|
||||
.table-bottom .layui-table-page {position: inherit;text-align: right}
|
||||
.table-tab .layui-tab-content{margin-bottom: 0;}
|
||||
.screen {margin-top: 15px}
|
||||
.layui-layout-admin.admin-style-2 .screen{margin-bottom: 15px;}
|
||||
.layui-layout-admin.admin-style-2 .layui-form-item .layui-input-inline{background-color: #fff;}
|
||||
</style>
|
||||
{/block}
|
||||
|
||||
{block name="main"}
|
||||
<!-- 搜索栏 -->
|
||||
<div class="screen layui-collapse" lay-filter="selection_panel">
|
||||
<div class="layui-colla-item">
|
||||
<div class="layui-colla-content layui-form layui-show" lay-filter="search_form">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">昵称/账户</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="search_text" placeholder="请输入会员昵称/账户" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">会员ID</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="member_id" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">发生方式</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="from_type">
|
||||
<option value="">全部</option>
|
||||
{foreach $typeList as $item}
|
||||
<option value="{$item['type']}">{$item['type_name']}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">发生时间</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" class="layui-input" name="start_time" placeholder="开始时间" id="start_time" readonly>
|
||||
<i class=" iconrili iconfont calendar"></i>
|
||||
</div>
|
||||
<div class="layui-form-mid">-</div>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" class="layui-input" name="end_time" placeholder="结束时间" id="end_time" readonly>
|
||||
<i class=" iconrili iconfont calendar"></i>
|
||||
</div>
|
||||
<button class="layui-btn layui-btn-primary date-picker-btn date-picker-btn-seven" onclick="datePick(7, this);return false;">近7天</button>
|
||||
<button class="layui-btn layui-btn-primary date-picker-btn date-picker-btn-thirty" onclick="datePick(30, this);return false;">近30天</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<button class="layui-btn" lay-submit="" id="search" lay-filter="search">筛选</button>
|
||||
<button type="reset" lay-submit lay-filter="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--表格内容-->
|
||||
<table id="account_detail" lay-filter="account_detail"></table>
|
||||
<!--用户信息-->
|
||||
<script type="text/html" id="memberInfo">
|
||||
<div class='table-title'>
|
||||
<div class='title-pic'>
|
||||
<img layer-src src="{{ns.img(d.headimg)}}" onerror="this.src = '{:img('public/static/img/default_img/head.png')}' ">
|
||||
</div>
|
||||
<div class='title-content'>
|
||||
<p class="layui-elip">昵称:{{d.nickname}}</p>
|
||||
<p class="layui-elip">账户:{{d.username}}</p>
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
{/block}
|
||||
|
||||
{block name="script"}
|
||||
<script>
|
||||
var form, layDate,table;
|
||||
$(function () {
|
||||
layui.use(['laydate','form', 'element'], function(){
|
||||
form = layui.form;
|
||||
layDate = layui.laydate;
|
||||
// 内容初始化
|
||||
form.render('select');
|
||||
layDate.render({
|
||||
elem: '#start_time',
|
||||
type: 'datetime',
|
||||
max: 0,
|
||||
change: function(value, date, endDate){
|
||||
$(".date-picker-btn").removeClass("selected");
|
||||
}
|
||||
});
|
||||
layDate.render({
|
||||
elem: '#end_time',
|
||||
type: 'datetime',
|
||||
max: 0,
|
||||
change: function(value, date, endDate){
|
||||
$(".date-picker-btn").removeClass("selected");
|
||||
}
|
||||
});
|
||||
// 渲染表格
|
||||
table = new Table({
|
||||
elem: '#account_detail',
|
||||
url: ns.url("fenxiao://shop/fenxiao/accountStatement"),
|
||||
cols: [[
|
||||
{title: 'ID', field: 'member_id', width: '5%', unresize: 'false', align: 'center'},
|
||||
{templet: '#memberInfo', title: '会员信息', width: '20%', unresize: 'false', align: 'left'},
|
||||
{
|
||||
title: '金额变化', width: '10%', unresize: 'false', align: 'center', templet: function (d) {
|
||||
let money = parseFloat(d.money).toFixed(2);
|
||||
if (money > 0) return '+' + money;
|
||||
return money;
|
||||
}
|
||||
},
|
||||
{title: '变更类型', field: 'type_name', width: '10%', unresize: 'false', align: 'center'},
|
||||
{
|
||||
field: 'create_time', title: '变更时间', width: '20%', unresize: 'false', align: 'center', templet: function (data) {
|
||||
return ns.time_to_date(data.create_time);
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
{title: '备注', field: 'remarks', unresize: 'false', align: 'center'},
|
||||
]]
|
||||
});
|
||||
// 点击搜索
|
||||
form.on('submit(search)', function(data) {
|
||||
// 时间判断
|
||||
if ($('#start_time').val() != '' && $('#end_time').val() != '' && (new Date($('#end_time').val()).getTime() <= new Date($('#start_time').val()).getTime() )) {
|
||||
layer.msg('结束时间不能小于开始时间');
|
||||
return false;
|
||||
}
|
||||
// 开始搜索
|
||||
table.reload({
|
||||
page: {
|
||||
curr: 1
|
||||
},
|
||||
where: data.field
|
||||
});
|
||||
return false;
|
||||
});
|
||||
// 重置表单
|
||||
form.on('submit(reset)', function(data) {
|
||||
let field = {
|
||||
"search_text": "",
|
||||
"from_type": "",
|
||||
"start_time": "",
|
||||
"end_time": "",
|
||||
"member_id": "",
|
||||
};
|
||||
form.val("search_form", field);
|
||||
layui.form.render();
|
||||
// 刷新表格
|
||||
table.reload({
|
||||
page: {
|
||||
curr: 1
|
||||
},
|
||||
where: field
|
||||
});
|
||||
});
|
||||
})
|
||||
});
|
||||
// 指定时间段
|
||||
function datePick(date_num,event_obj){
|
||||
$(".date-picker-btn").removeClass("selected");
|
||||
$(event_obj).addClass('selected');
|
||||
// alert(new Date().format("yyyy-MM-dd hh:mm"));
|
||||
var now_date = new Date();
|
||||
|
||||
Date.prototype.Format = function (fmt,date_num) { //author: meizz
|
||||
this.setDate(this.getDate()-date_num);
|
||||
var o = {
|
||||
"M+": this.getMonth() + 1, //月份
|
||||
"d+": this.getDate(), //日
|
||||
"H+": this.getHours(), //小时
|
||||
"m+": this.getMinutes(), //分
|
||||
"s+": this.getSeconds(), //秒
|
||||
"q+": Math.floor((this.getMonth() + 3) / 3), //季度
|
||||
"S": this.getMilliseconds() //毫秒
|
||||
};
|
||||
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
|
||||
for (var k in o)
|
||||
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
|
||||
return fmt;
|
||||
};
|
||||
// var now_time = new Date().Format("yyyy-MM-dd HH:mm:ss",0);//当前日期
|
||||
var now_time = new Date().Format("yyyy-MM-dd 23:59:59",0);//当前日期
|
||||
var before_time = new Date().Format("yyyy-MM-dd 00:00:00",date_num-1);//前几天日期
|
||||
$("input[name=start_time]").val(before_time,0);
|
||||
$("input[name=end_time]").val(now_time,date_num-1);
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
|
|
@ -2,11 +2,6 @@
|
|||
{block name="resources"}
|
||||
<link rel="stylesheet" type="text/css" href="REPLACEBUY_CSS/index.css"/>
|
||||
<style>
|
||||
.fenxiao-header {
|
||||
padding: 50px 0 100px 50px;
|
||||
font-size: 20px;
|
||||
font-weight: 600;
|
||||
}
|
||||
.layui-form {
|
||||
position: relative;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -72,6 +72,7 @@
|
|||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="parent_fenxiao_id" id="" {if $parent_info}value="{$parent_info.fenxiao_id }"{/if}/>
|
||||
<!-- 列表 -->
|
||||
<table id="fenxiao_list" lay-filter="fenxiao_list"></table>
|
||||
|
|
@ -134,7 +135,7 @@
|
|||
field: 'fenxiao_name',
|
||||
title: '分销商名称',
|
||||
unresize: 'false',
|
||||
width: '15%'
|
||||
width: '30%'
|
||||
}
|
||||
// , {
|
||||
// field: 'parent_name',
|
||||
|
|
@ -153,7 +154,7 @@
|
|||
field: 'level_name',
|
||||
title: '分销等级',
|
||||
unresize: 'false',
|
||||
width: '10%'
|
||||
width: '20%'
|
||||
}, {
|
||||
field: 'status',
|
||||
title: '当前状态',
|
||||
|
|
@ -197,7 +198,6 @@
|
|||
var data = obj.data,
|
||||
event = obj.event;
|
||||
switch (event) {
|
||||
|
||||
case 'confirm': //确认更改上下级关系
|
||||
layer.confirm('确定要将该分销商变更为上级分销商吗?', function () {
|
||||
if (repeat_flag) return;
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
[{
|
||||
title: '等级',
|
||||
unresize: 'false',
|
||||
width: '15%',
|
||||
width: '20%',
|
||||
templet: function (data) {
|
||||
let level = new Array();
|
||||
level[0] = '默认等级';
|
||||
|
|
@ -52,12 +52,12 @@
|
|||
field: 'level_name',
|
||||
title: '等级名称',
|
||||
unresize: 'false',
|
||||
width: '15%',
|
||||
width: '20%',
|
||||
}, {
|
||||
field: 'one_rate',
|
||||
title: '一级佣金比例',
|
||||
unresize: 'false',
|
||||
width: '15%',
|
||||
width: '20%',
|
||||
templet: function(data) {
|
||||
return data.one_rate + '%';
|
||||
},
|
||||
|
|
@ -66,7 +66,7 @@
|
|||
field: 'two_rate',
|
||||
title: '二级佣金比例',
|
||||
unresize: 'false',
|
||||
width: '15%',
|
||||
width: '20%',
|
||||
templet: function(data) {
|
||||
return data.two_rate + '%';
|
||||
},
|
||||
|
|
@ -75,7 +75,7 @@
|
|||
field:'three_rate',
|
||||
title: '三级佣金比例',
|
||||
unresize: 'false',
|
||||
width: '15%',
|
||||
width: '20%',
|
||||
templet: function(data) {
|
||||
return data.three_rate + '%';
|
||||
},
|
||||
|
|
@ -89,19 +89,6 @@
|
|||
]
|
||||
});
|
||||
|
||||
/**
|
||||
* 搜索功能
|
||||
*/
|
||||
form.on('submit(search)', function(data) {
|
||||
table.reload({
|
||||
page: {
|
||||
curr: 1
|
||||
},
|
||||
where: data.field
|
||||
});
|
||||
return false;
|
||||
});
|
||||
|
||||
/**
|
||||
* 监听工具栏操作
|
||||
*/
|
||||
|
|
@ -109,7 +96,6 @@
|
|||
var data = obj.data,
|
||||
event = obj.event;
|
||||
switch (event) {
|
||||
|
||||
case 'confirm': //确认更改上下级关系
|
||||
layer.confirm('确定要将该分销商变更到此分销等级吗?', function () {
|
||||
if (repeat_flag) return;
|
||||
|
|
|
|||
|
|
@ -9,52 +9,10 @@
|
|||
.shop-account>a{position: absolute;right: 15px;bottom: 15px;cursor: pointer;}
|
||||
.item-block-parent{justify-content: flex-start; margin-top: 10px;}
|
||||
.layui-layout-admin.admin-style-2 .table-tab .layui-tab-title{margin-bottom: 15px;}
|
||||
.calendar{line-height: 34px;text-align: center;}
|
||||
</style>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
|
||||
<div class="form-wrap">
|
||||
<div class="layui-card-body item-block-parent shop-account">
|
||||
<div class="shop-detail">
|
||||
<p><strong>分销商:</strong><span>{$fenxiao_info.fenxiao_name}</span></p>
|
||||
<p><strong>上级分销商:</strong><span>{if $fenxiao_info.parent_name == ''} 无 {else /}{$fenxiao_info.parent_name} {/if}</span></p>
|
||||
<p><strong>联系方式:</strong><span>{$fenxiao_info.mobile}</span></p>
|
||||
<p><strong>分销等级:</strong><span>{$fenxiao_info.level_name}</span></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-card card-common card-brief">
|
||||
<div class="layui-card-header">
|
||||
<div>
|
||||
<span class="card-title">账户概况</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<div class="content">
|
||||
<p class="title">当前佣金(元)</p>
|
||||
<p class="money">{$fenxiao_info.account}</p>
|
||||
</div>
|
||||
<div class="content">
|
||||
<p class="title">已提现佣金(元)</p>
|
||||
<p class="money">{$fenxiao_info.account_withdraw}</p>
|
||||
</div>
|
||||
<div class="content">
|
||||
<p class="title">提现中佣金(元)</p>
|
||||
<p class="money">{$fenxiao_info.account_withdraw_apply}</p>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-card card-common card-brief">
|
||||
<div class="layui-card-header">
|
||||
<div>
|
||||
<span class="card-title">账户流水记录</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{block name="body"}
|
||||
<!-- 筛选面板 -->
|
||||
<div class="single-filter-box">
|
||||
<div class="layui-form">
|
||||
|
|
|
|||
|
|
@ -1,85 +1,144 @@
|
|||
{extend name="app/shop/view/base.html"/}
|
||||
{block name="resources"}
|
||||
<link rel="stylesheet" type="text/css" href="__STATIC__/ext/layui/extend/cascader/cascader.css"/>
|
||||
<style>
|
||||
.layui-layer-content .form-wrap {padding: 0}
|
||||
.layui-layer-page .layui-layer-content {overflow-y: auto!important;}
|
||||
.layui-layout-admin .layui-body .body-content {background: none;padding: 0}
|
||||
.info-wrap {display: flex}
|
||||
.info-wrap .layui-card {flex: 1;margin-top: 0}
|
||||
.info-wrap .layui-card:first-child {margin-right: 15px}
|
||||
.member-info {display: flex}
|
||||
.member-info .headimg {margin-right: 15px;width: 70px;height: 70px;display: flex;align-items: center;justify-content: center;overflow: hidden}
|
||||
.member-info .headimg img {max-width: 100%;height: auto}
|
||||
.member-info .info {flex: 1;width: 0;display: flex;flex-wrap: wrap}
|
||||
.member-info .info .data-item {width: 50%;padding-right: 10px;box-sizing: border-box;line-height: 30px}
|
||||
.member-info .data-item .layui-icon {cursor: pointer}
|
||||
.layui-tab-content {padding: 0}
|
||||
.screen {margin: 15px 0}
|
||||
.fourstage-nav.layui-tab.layui-tab-brief{display: none;}
|
||||
.layui-layout-admin.admin-style-2 .layui-body .layui-tab + .body-content{padding-top: 0 !important;}
|
||||
.card-brief .layui-card-header{padding-top: 5px !important;}
|
||||
.card-common .layui-card-body{padding-top: 10px;}
|
||||
</style>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<div class="layui-form">
|
||||
<div class="layui-card card-common">
|
||||
<div class="layui-card-header">
|
||||
<span class="card-title">分销商信息</span>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">分销商编号:</label>
|
||||
<div class="layui-input-inline">{$info.fenxiao_no}</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">分销商:</label>
|
||||
<div class="layui-input-inline">{$info.fenxiao_name}</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">会员账号:</label>
|
||||
<div class="layui-input-inline">{$info.username}</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">上级分销商:</label>
|
||||
<div class="layui-input-inline">{if $info.parent_name == ''} 无 {else /}{$info.parent_name} {/if}</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">分销商等级:</label>
|
||||
<div class="layui-input-inline">{$level.level_name}</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">当前佣金:</label>
|
||||
<div class="layui-input-inline">{$info.account} 元</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">已提现佣金:</label>
|
||||
<div class="layui-input-inline">{$info.account_withdraw} 元</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">提现中佣金:</label>
|
||||
<div class="layui-input-inline">{$info.account_withdraw_apply} 元</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">当前状态:</label>
|
||||
<div class="layui-input-inline">{$status[$info['status']]}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-card card-common">
|
||||
<div class="layui-card-header">
|
||||
<span class="card-title">账户概况</span>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<div class="info-wrap">
|
||||
<div class="layui-card card-common card-brief">
|
||||
<div class="layui-card-header">
|
||||
<div>
|
||||
<span class="card-title">基础信息</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<div class="member-info">
|
||||
<div class="info">
|
||||
<div class="data-item">
|
||||
<span>分销商编号:</span>
|
||||
<span>{$info.fenxiao_no}</span>
|
||||
</div>
|
||||
<div class="data-item">
|
||||
<span>分销商:</span>
|
||||
<span>{$info.fenxiao_name}</span>
|
||||
</div>
|
||||
<div class="data-item">
|
||||
<span>会员账号:</span>
|
||||
<span><a href="{:addon_url('shop/member/editmember?member_id=')}{$info.member_id}" target="_blank" class="text-color">{$info.username}</a></span>
|
||||
</div>
|
||||
<div class="data-item">
|
||||
<span>上级分销商:</span>
|
||||
<span>{if $info.parent_name == ''} 无 {else /}{$info.parent_name} {/if}</span>
|
||||
</div>
|
||||
<div class="data-item">
|
||||
<span>分销商等级:</span>
|
||||
<span>{$level.level_name}</span>
|
||||
</div>
|
||||
<div class="data-item">
|
||||
<span>当前佣金:</span>
|
||||
<span>{$info.account} 元</span>
|
||||
</div>
|
||||
<div class="data-item">
|
||||
<span>已提现佣金:</span>
|
||||
<span>{$info.account_withdraw} 元</span>
|
||||
</div>
|
||||
<div class="data-item">
|
||||
<span>提现中佣金:</span>
|
||||
<span>{$info.account_withdraw_apply} 元</span>
|
||||
</div>
|
||||
<div class="data-item">
|
||||
<span>当前状态:</span>
|
||||
<span>{$status[$info['status']]}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">一级分销订单总数:</label>
|
||||
<div class="layui-input-inline">{$info.one_fenxiao_order_num}</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">一级分销订单总额:</label>
|
||||
<div class="layui-input-inline">{$info.one_fenxiao_order_money} 元</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">一级下线人数:</label>
|
||||
<div class="layui-input-inline">{$info.one_child_num} 人</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">一级下线分销商:</label>
|
||||
<div class="layui-input-inline">{$info.one_child_fenxiao_num} 人</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-card card-common card-brief">
|
||||
<div class="layui-card-header">
|
||||
<div>
|
||||
<span class="card-title">账户信息</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-card-body">
|
||||
<div class="member-info">
|
||||
<div class="info">
|
||||
<div class="data-item">
|
||||
<span>一级分销订单总数:</span>
|
||||
<span id="member_balance">{$info.one_fenxiao_order_num}</span>
|
||||
</div>
|
||||
<div class="data-item">
|
||||
<span>一级分销订单总额:</span>
|
||||
<span>{$info.one_fenxiao_order_money} 元</span>
|
||||
</div>
|
||||
<div class="data-item">
|
||||
<span>一级下线人数:</span>
|
||||
<span>{$info.one_child_num} 人</span>
|
||||
</div>
|
||||
<div class="data-item">
|
||||
<span>一级下线分销商:</span>
|
||||
<span>{$info.one_child_fenxiao_num} 人</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form form-wrap">
|
||||
<div class="layui-card card-common card-brief">
|
||||
<div class="layui-card-header">
|
||||
<div>
|
||||
<span class="card-title">分销商信息</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-card-body layui-tab layui-tab-brief" lay-filter="edit_user_tab">
|
||||
<ul class="layui-tab-title">
|
||||
<li class="layui-this" lay-id="basic_info">分销商团队</li>
|
||||
<li lay-id="basic_info">账户流水记录</li>
|
||||
<li lay-id="basic_info">订单管理</li>
|
||||
</ul>
|
||||
<div class="layui-tab-content">
|
||||
<div class="layui-tab-item layui-show">
|
||||
<iframe src="{:url('fenxiao/shop/fenxiao/team',array('fenxiao_id'=>$info.fenxiao_id))}" style="width:100%;height:100vh;border:0"></iframe>
|
||||
</div>
|
||||
<div class="layui-tab-item">
|
||||
<iframe src="{:url('fenxiao/shop/fenxiao/account',array('fenxiao_id'=>$info.fenxiao_id))}" style="width:100%;height:100vh;border:0"></iframe>
|
||||
</div>
|
||||
<div class="layui-tab-item">
|
||||
<iframe src="{:url('fenxiao/shop/fenxiao/order',array('fenxiao_id'=>$info.fenxiao_id))}" style="width:100%;height:100vh;border:0"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="layui-form form-wrap">
|
||||
<div class="form-row">
|
||||
<button class="layui-btn layui-btn-primary" onclick="back()">返回</button>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
{/block}
|
||||
{block name="script"}
|
||||
<script>
|
||||
|
|
|
|||
|
|
@ -4,12 +4,12 @@
|
|||
.layui-layout-admin.admin-style-2 .table-tab .layui-tab-title{margin-bottom: 15px;}
|
||||
</style>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
{block name="body"}
|
||||
<div class="layui-tab table-tab" lay-filter="team_list_tab">
|
||||
<ul class="layui-tab-title">
|
||||
<li class="layui-this" data-status="0" data-type="live_status">推荐会员</li>
|
||||
{if $fenxiao_level_num > 1}<li data-status="1" data-type="live_status">下级分销商</li>{/if}
|
||||
{if $fenxiao_level_num > 2}<li data-status="2" data-type="live_status">下下级分销商</li>{/if}
|
||||
<li class="layui-this" data-status="1" data-type="live_status">一级</li>
|
||||
{if $fenxiao_level_num > 1}<li data-status="2" data-type="live_status">二级</li>{/if}
|
||||
{if $fenxiao_level_num > 2}<li data-status="3" data-type="live_status">三级</li>{/if}
|
||||
</ul>
|
||||
<div class="layui-tab-content">
|
||||
<!-- 列表 -->
|
||||
|
|
@ -54,6 +54,14 @@
|
|||
width: '18%',
|
||||
unresize: 'false',
|
||||
templet: '#userdetail'
|
||||
}, {
|
||||
field: 'is_fenxiao',
|
||||
title: '是否是分销商',
|
||||
width: '8%',
|
||||
unresize: 'false',
|
||||
templet: function (data) {
|
||||
return data.is_fenxiao ? '是' : '否';
|
||||
}
|
||||
}, {
|
||||
field: 'order_money',
|
||||
title: '消费额',
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@
|
|||
.summary-wrap .common-wrap{margin:15px 15px 0 15px; flex: 1;padding: 15px; background: #fff;position: relative}
|
||||
.summary-wrap .common-wrap .head{display: flex;align-items: center;}
|
||||
.summary-wrap .common-wrap .head .title{font-size: 16px;font-weight: bolder;}
|
||||
.iconfont{color: #909399 !important;}
|
||||
/* 佣金概览 */
|
||||
.commission-wrap{height: 120px;background: #fff;position: relative;margin:35px 15px 0 15px;padding: 15px}
|
||||
.commission-wrap .commission-overview{display: flex;}
|
||||
|
|
@ -41,62 +40,62 @@
|
|||
</style>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<!--<div class="commission-wrap">-->
|
||||
<!-- <div class="header">-->
|
||||
<!-- <span>佣金概览</span>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="commission-overview">-->
|
||||
<!-- <div class="li">-->
|
||||
<!-- <div class="title prompt-block">-->
|
||||
<!-- 可提现佣金(元)-->
|
||||
<!-- <div class="prompt">-->
|
||||
<!-- <i class="iconfont iconwenhao1"></i>-->
|
||||
<!-- <div class="prompt-box">-->
|
||||
<!-- <div class="prompt-con">所有分销订单已完成,佣金已结算,可以提现的佣金(不包含已提现的佣金)</div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <p class="money">{$fenxiao_account}</p>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="li">-->
|
||||
<!-- <div class="title prompt-block">-->
|
||||
<!-- 提现待审核(元)-->
|
||||
<!-- <div class="prompt">-->
|
||||
<!-- <i class="iconfont iconwenhao1"></i>-->
|
||||
<!-- <div class="prompt-box">-->
|
||||
<!-- <div class="prompt-con">已申请提现等待管理审核的佣金</div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <p class="money">{if $account_data.account_withdraw_apply == null} 0.00 {else/}{$account_data.account_withdraw_apply}{/if}</p>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="li">-->
|
||||
<!-- <div class="title prompt-block">-->
|
||||
<!-- 提现佣金(元)-->
|
||||
<!-- <div class="prompt">-->
|
||||
<!-- <i class="iconfont iconwenhao1"></i>-->
|
||||
<!-- <div class="prompt-box">-->
|
||||
<!-- <div class="prompt-con">所有已经提现成功的佣金总和</div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <p class="money">{if $account_data.account_withdraw == null} 0.00 {else/}{$account_data.account_withdraw}{/if}</p>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div class="li">-->
|
||||
<!-- <div class="title prompt-block">-->
|
||||
<!-- 进行中佣金(元)-->
|
||||
<!-- <div class="prompt">-->
|
||||
<!-- <i class="iconfont iconwenhao1"></i>-->
|
||||
<!-- <div class="prompt-box">-->
|
||||
<!-- <div class="prompt-con">指所有分销订单待结算佣金的和</div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- <p class="money">{$commission_money}</p>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!--</div>-->
|
||||
<div class="summary-wrap" style="margin-top: 20px;">
|
||||
<div class="commission-wrap">
|
||||
<div class="header">
|
||||
<span>佣金概览</span>
|
||||
</div>
|
||||
<div class="commission-overview">
|
||||
<div class="li">
|
||||
<div class="title prompt-block">
|
||||
可提现佣金(元)
|
||||
<div class="prompt">
|
||||
<i class="iconfont iconwenhao1"></i>
|
||||
<div class="prompt-box">
|
||||
<div class="prompt-con">所有分销订单已完成,佣金已结算,可以提现的佣金(不包含已提现的佣金)</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p class="money">{$fenxiao_account}</p>
|
||||
</div>
|
||||
<div class="li">
|
||||
<div class="title prompt-block">
|
||||
提现待审核(元)
|
||||
<div class="prompt">
|
||||
<i class="iconfont iconwenhao1"></i>
|
||||
<div class="prompt-box">
|
||||
<div class="prompt-con">已申请提现等待管理审核的佣金</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p class="money">{if $account_data.account_withdraw_apply == null} 0.00 {else/}{$account_data.account_withdraw_apply}{/if}</p>
|
||||
</div>
|
||||
<div class="li">
|
||||
<div class="title prompt-block">
|
||||
提现佣金(元)
|
||||
<div class="prompt">
|
||||
<i class="iconfont iconwenhao1"></i>
|
||||
<div class="prompt-box">
|
||||
<div class="prompt-con">所有已经提现成功的佣金总和</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p class="money">{if $account_data.account_withdraw == null} 0.00 {else/}{$account_data.account_withdraw}{/if}</p>
|
||||
</div>
|
||||
<div class="li">
|
||||
<div class="title prompt-block">
|
||||
进行中佣金(元)
|
||||
<div class="prompt">
|
||||
<i class="iconfont iconwenhao1"></i>
|
||||
<div class="prompt-box">
|
||||
<div class="prompt-con">指所有分销订单待结算佣金的和</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p class="money">{$commission_money}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="summary-wrap">
|
||||
<div class="fenxiao-wrap">
|
||||
<div class="header">
|
||||
<span>分销商概览</span>
|
||||
|
|
|
|||
|
|
@ -91,38 +91,6 @@
|
|||
<!-- 列表 -->
|
||||
<table id="fenxiao_list" lay-filter="fenxiao_list"></table>
|
||||
|
||||
<!-- 余额弹框html -->
|
||||
<script type="text/html" id="balance">
|
||||
<div class="layui-form">
|
||||
<!-- <div class="layui-form-item">
|
||||
<label class="layui-form-label">当前购房券:</label>
|
||||
<div class="layui-input-block account-value">{{ d.house_purchase }}</div>
|
||||
</div> -->
|
||||
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">核销数额:</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="number" value="0" placeholder="请输入核销数额" name="adjust_num" lay-verify="num" class="layui-input len-short">
|
||||
</div>
|
||||
<span class="word-aux">核销数额不可小于等于0,核销数额与当前购房券相减不能小于0</span>
|
||||
</div>
|
||||
|
||||
<!-- <div class="layui-form-item">-->
|
||||
<!-- <label class="layui-form-label">备注:</label>-->
|
||||
<!-- <div class="layui-input-block len-long">-->
|
||||
<!-- <textarea class="layui-textarea" name="remark" placeholder="请输入备注" maxlength="150"></textarea>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<div class="form-row">
|
||||
<button class="layui-btn" lay-submit lay-filter="saveBalance">确定</button>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="fenxiao_id" value="{{d.fenxiao_id}}" />
|
||||
<input type="hidden" name="house_purchase" value="{{ d.house_purchase }}" />
|
||||
</div>
|
||||
</script>
|
||||
|
||||
<!-- 用户信息 -->
|
||||
<script type="text/html" id="account">
|
||||
<div class="layui-elip">当前佣金:{{d.account}}</div>
|
||||
|
|
@ -176,7 +144,6 @@
|
|||
<script type="text/html" id="operation">
|
||||
<div class="table-btn">
|
||||
<a class="layui-btn" lay-event="detail">查看</a>
|
||||
|
||||
{{# if(d.status == 1){ }}
|
||||
<a class="layui-btn" lay-event="frozen">冻结</a>
|
||||
<!-- <a class="layui-btn" lay-event="change">上级分销商变更</a> -->
|
||||
|
|
@ -190,11 +157,10 @@
|
|||
|
||||
{block name="script"}
|
||||
<script>
|
||||
var table,form,laydate,laytpl;
|
||||
layui.use(['form', 'laydate', 'laytpl'], function() {
|
||||
var table,form,laydate;
|
||||
layui.use(['form', 'laydate'], function() {
|
||||
form = layui.form;
|
||||
laydate = layui.laydate;
|
||||
laytpl = layui.laytpl;
|
||||
form.render();
|
||||
|
||||
//渲染时间
|
||||
|
|
@ -225,24 +191,21 @@
|
|||
},{
|
||||
title: '上级分销商',
|
||||
unresize: 'false',
|
||||
width: '10%',
|
||||
width: '15%',
|
||||
templet: '#parent_name',
|
||||
align:'left'
|
||||
},
|
||||
{
|
||||
}, {
|
||||
title: '分销等级',
|
||||
unresize: 'false',
|
||||
width: '15%',
|
||||
templet: '#level_name',
|
||||
align:'left'
|
||||
},
|
||||
// {
|
||||
// title: '佣金账户',
|
||||
// width:'10%',
|
||||
// unresize: 'false',
|
||||
// templet: '#account'
|
||||
// },
|
||||
{
|
||||
}, {
|
||||
title: '佣金账户',
|
||||
width:'10%',
|
||||
unresize: 'false',
|
||||
templet: '#account'
|
||||
}, {
|
||||
|
||||
title: '团队人数',
|
||||
unresize: 'false',
|
||||
|
|
@ -251,48 +214,21 @@
|
|||
return data.team_num;
|
||||
}
|
||||
}, {
|
||||
|
||||
title: '积分',
|
||||
unresize: 'false',
|
||||
width: '8%',
|
||||
templet: function(data){
|
||||
return data.points;
|
||||
}
|
||||
},
|
||||
// {
|
||||
//
|
||||
// title: '贡献值',
|
||||
// unresize: 'false',
|
||||
// width: '8%',
|
||||
// templet: function(data){
|
||||
// return data.contribution;
|
||||
// }
|
||||
// },
|
||||
// {
|
||||
//
|
||||
// title: '购房券',
|
||||
// unresize: 'false',
|
||||
// width: '8%',
|
||||
// templet: function(data){
|
||||
// return data.house_purchase;
|
||||
// }
|
||||
// },
|
||||
{
|
||||
field: 'status',
|
||||
title: '当前状态',
|
||||
templet: '#status',
|
||||
unresize: 'false',
|
||||
width: '8%'
|
||||
width: '7%'
|
||||
}, {
|
||||
field: 'create_time',
|
||||
title: '添加时间',
|
||||
unresize: 'false',
|
||||
width: '12%',
|
||||
width: '10%',
|
||||
templet: function(data) {
|
||||
let time = ns.time_to_date(data.create_time).split(' ');
|
||||
return `<div class="time-lineheight">
|
||||
<div>`+ time[0] +` `+ time[1] +`</div>
|
||||
<!-- <div>`+ time[1] +`</div>-->
|
||||
<div>`+ time[0] +`</div>
|
||||
<div>`+ time[1] +`</div>
|
||||
</div>`;
|
||||
}
|
||||
}, {
|
||||
|
|
@ -381,43 +317,8 @@
|
|||
}
|
||||
});
|
||||
break;
|
||||
case 'adjust_house_purchase': //调整余额
|
||||
adjustBalance(data);
|
||||
break;
|
||||
}
|
||||
});
|
||||
var repeat_flag_balance = false;
|
||||
form.on('submit(saveBalance)', function(data) {
|
||||
if (repeat_flag_balance) return false;
|
||||
repeat_flag_balance = true;
|
||||
|
||||
var house_purchase = data.field.house_purchase;
|
||||
if (data.field.adjust_num <= 0) {
|
||||
layer.msg('调整数值不能为负数');
|
||||
repeat_flag_balance = false;
|
||||
return ;
|
||||
}
|
||||
if (house_purchase*1 - data.field.adjust_num*1 < 0) {
|
||||
layer.msg('购房券不足,不可以为负数');
|
||||
repeat_flag_balance = false;
|
||||
return ;
|
||||
}
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: ns.url("fenxiao://shop/fenxiao/adjustHousePurchase"),
|
||||
data: data.field,
|
||||
dataType: 'JSON',
|
||||
success: function(res) {
|
||||
layer.msg(res.message);
|
||||
repeat_flag_balance = false;
|
||||
|
||||
if (res.code == 0) {
|
||||
layer.closeAll('page');
|
||||
table.reload();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function change(member_id){
|
||||
|
|
@ -441,7 +342,7 @@
|
|||
var layerIndex = layer.open({
|
||||
title: "变更分销商等级",
|
||||
type: 2,
|
||||
area: ['1200px', '800px'],
|
||||
area: ['800px', '650px'],
|
||||
// btn: '保存',
|
||||
content: url,
|
||||
end: function () {
|
||||
|
|
@ -457,19 +358,5 @@
|
|||
{
|
||||
location.href = ns.url('fenxiao://shop/fenxiao/add');
|
||||
}
|
||||
|
||||
// 调整余额
|
||||
function adjustBalance(e){
|
||||
laytpl($("#balance").html()).render(e, function(html) {
|
||||
layer.open({
|
||||
title: '调整储值余额',
|
||||
skin: 'layer-tips-class',
|
||||
type: 1,
|
||||
area: ['800px'],
|
||||
content: html
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
{/block}
|
||||
|
|
@ -1,17 +1,12 @@
|
|||
{extend name="app/shop/view/base.html"/}
|
||||
{block name="resources"}
|
||||
<link rel="stylesheet" href="FENXIAO_CSS/order_list.css">
|
||||
<style>
|
||||
.screen .layui-colla-content {border: none;background-color: #F2F3F5;}
|
||||
.screen .layui-colla-content .layui-input{background-color: #fff !important;}
|
||||
</style>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<div class="layui-collapse tips-wrap">
|
||||
<div class="layui-colla-item">
|
||||
<h2 class="layui-colla-title">操作提示</h2>
|
||||
<ul class="layui-colla-content layui-show">
|
||||
<li>分销商列表</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{block name="body"}
|
||||
<div class="screen layui-collapse" lay-filter="selection_panel">
|
||||
<div class="layui-colla-item">
|
||||
<form class="layui-colla-content layui-form layui-show">
|
||||
|
|
@ -72,13 +67,13 @@
|
|||
<div id="order_list"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="order_page"></div>
|
||||
{/block}
|
||||
|
||||
{block name="script"}
|
||||
<script src="FENXIAO_JS/order_list.js"></script>
|
||||
<script>
|
||||
var laypage,element, form;
|
||||
var is_refresh = false;
|
||||
|
||||
/**
|
||||
*通过hash获取页数
|
||||
|
|
@ -102,7 +97,6 @@
|
|||
//从hash中获取数据
|
||||
function getHashData(){
|
||||
var hash = ns.urlReplace(location.hash);
|
||||
var data= [];
|
||||
|
||||
var hash_arr = hash.split("&");
|
||||
|
||||
|
|
@ -161,9 +155,8 @@
|
|||
|
||||
//监听筛选事件
|
||||
form.on('submit(search)', function(data){
|
||||
is_refresh = true;
|
||||
data.field.page = 1;
|
||||
getOrderList(data.field);
|
||||
setHashOrderList(data.field);
|
||||
return false;
|
||||
});
|
||||
|
||||
|
|
@ -199,6 +192,7 @@
|
|||
if(!first){
|
||||
var hash_data = getHashData();
|
||||
hash_data.page = obj.curr;
|
||||
setHashOrderList(hash_data);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
|
@ -209,6 +203,23 @@
|
|||
});
|
||||
}
|
||||
|
||||
function setHashOrderList(data){
|
||||
var hash = "";
|
||||
$.each(data,function(index, itemobj){
|
||||
if(itemobj != "" && itemobj != "all"){
|
||||
if(hash == ""){
|
||||
hash += "#!"+index +"="+itemobj;
|
||||
}else{
|
||||
hash += "&"+index +"="+itemobj;
|
||||
}
|
||||
}
|
||||
});
|
||||
// window.location.href = hash;
|
||||
hash_url = hash;
|
||||
location.hash = hash;
|
||||
getOrderList(data);
|
||||
}
|
||||
|
||||
//从hash中获取数据
|
||||
function getHashData(){
|
||||
var hash = ns.urlReplace(location.hash);
|
||||
|
|
|
|||
|
|
@ -1,198 +0,0 @@
|
|||
{extend name="app/shop/view/base.html"/}
|
||||
{block name="resources"}
|
||||
<style>
|
||||
.id-card-content{
|
||||
width: 100%;
|
||||
display: inline-flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.id-card-content .id-card-img{}
|
||||
.id-card-content .id-card-img img{
|
||||
width: 120px!important;
|
||||
max-width: none;
|
||||
}
|
||||
.id-card-content .id-card{}
|
||||
</style>
|
||||
{/block}
|
||||
|
||||
{block name="main"}
|
||||
<!-- 筛选面板 -->
|
||||
<div class="screen layui-collapse" lay-filter="selection_panel">
|
||||
<div class="layui-colla-item">
|
||||
<div class="layui-colla-content layui-form layui-show" lay-filter="search_form">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">姓名:</label>
|
||||
<div class="layui-input-inline">
|
||||
<input type="text" name="nickname" placeholder="" autocomplete="off" class="layui-input"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">审核状态:</label>
|
||||
<div class="layui-input-inline">
|
||||
<select name="status" lay-filter="is_settlement">
|
||||
<option value="">全部</option>
|
||||
<option value="1">审核中</option>
|
||||
<option value="2">已通过</option>
|
||||
<option value="3">已驳回</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-row">
|
||||
<button class="layui-btn" lay-submit lay-filter="search">筛选</button>
|
||||
<button type="reset" lay-submit lay-filter="reset" class="layui-btn layui-btn-primary">重置</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 列表 -->
|
||||
<table id="listContent" lay-filter="listContent"></table>
|
||||
<!-- 操作 -->
|
||||
<script type="text/html" id="operation">
|
||||
<div class="table-btn">
|
||||
{{# if(d.status == 1){ }}
|
||||
<a class="layui-btn" lay-event="examinePass">通过</a>
|
||||
<a class="layui-btn" lay-event="examineReject">驳回</a>
|
||||
{{# } }}
|
||||
</div>
|
||||
</script>
|
||||
<!--会员信息-->
|
||||
<script type="text/html" id="memberInfo">
|
||||
<div class='table-title'>
|
||||
<div class='title-pic'>
|
||||
<img layer-src src="{{ns.img(d.headimg)}}" onerror="this.src = '{:img(\'public/static/img/default_img/head.png\')}' ">
|
||||
</div>
|
||||
<div class='title-content'>
|
||||
{{# if(d.seller_username){ }}
|
||||
<p class="layui-elip">{{d.username}}</p>
|
||||
{{# } else { }}
|
||||
<p class="layui-elip">{{d.nickname}}</p>
|
||||
{{# } }}
|
||||
</div>
|
||||
</div>
|
||||
</script>
|
||||
<!--商品信息-->
|
||||
<script type="text/html" id="goodsInfo">
|
||||
<div class='id-card-content'>
|
||||
<!--身份证正反面-->
|
||||
<div class="id-card-img">
|
||||
<img layer-src src="{{ns.img(d.id_card_front)}}">
|
||||
<img layer-src src="{{ns.img(d.id_card_reverse)}}">
|
||||
</div>
|
||||
<!--身份证信息-->
|
||||
<div class="id-card">身份证号:{{ d.id_card }}</div>
|
||||
</div>
|
||||
</script>
|
||||
{/block}
|
||||
|
||||
{block name="script"}
|
||||
<script>
|
||||
var table, form, editIframe, repeat_flag = false;//防重复标识;
|
||||
layui.use(['form'], function() {
|
||||
form = layui.form;
|
||||
form.render();
|
||||
// 内容获取
|
||||
table = new Table({
|
||||
elem: '#listContent',
|
||||
url: ns.url("fenxiao://shop/fenxiao/upgradeApply"),
|
||||
cols: [[
|
||||
{align: 'center', field: 'id', title: 'ID', width: '5%', unresize: 'false'},
|
||||
{align: 'left', title: '用户信息', unresize: 'area',width: '15%', templet: '#memberInfo'},
|
||||
{align: 'center', title: '身份证信息', unresize: 'area',width: '35%', templet: '#goodsInfo'},
|
||||
{align: 'center', title: '用户真实姓名', field: 'username',width: '10%', unresize: 'area'},
|
||||
{align: 'center', title: '手机号', field: 'phone',width: '10%', unresize: 'area'},
|
||||
{
|
||||
align: 'center',width: '5%', templet: function (d) {
|
||||
// 申请状态(1申请中 2通过 3驳回)
|
||||
let statusText = '';
|
||||
switch (parseInt(d.status)) {
|
||||
case 1: statusText = '<p>申请中</p>'; break;
|
||||
case 2: statusText = '<p style="color: #07c160;">通过</p>'; break;
|
||||
case 3: statusText = '<p style="color: #ad0000;">驳回</p>'; break;
|
||||
}
|
||||
return statusText;
|
||||
}, title: '状态', unresize: 'false'
|
||||
},
|
||||
{
|
||||
align: 'center',width: '10%', templet: function (d) {
|
||||
return ns.time_to_date(d.update_time,'YYYY-MM-DD h:m');
|
||||
}, title: '申请时间', unresize: 'false'
|
||||
},
|
||||
{title: '操作',width: '10%', toolbar: '#operation', unresize: 'false', align: 'right'}
|
||||
]],
|
||||
});
|
||||
// 点击搜索
|
||||
form.on('submit(search)', function(data) {
|
||||
table.reload({
|
||||
page: {
|
||||
curr: 1
|
||||
},
|
||||
where: data.field
|
||||
});
|
||||
return false;
|
||||
});
|
||||
// 重置表单
|
||||
form.on('submit(reset)', function(data) {
|
||||
let field = {
|
||||
"nickname": "",
|
||||
"status": "",
|
||||
};
|
||||
form.val("search_form", field);
|
||||
layui.form.render();
|
||||
// 刷新表格
|
||||
table.reload({
|
||||
page: {
|
||||
curr: 1
|
||||
},
|
||||
where: field
|
||||
});
|
||||
});
|
||||
// 监听工具栏操作
|
||||
table.tool(function(obj) {
|
||||
var data = obj.data;
|
||||
eval(obj.event)(data)
|
||||
});
|
||||
});
|
||||
// 审核 - 通过
|
||||
function examinePass(data){
|
||||
layer.confirm('确认当前用户升级请求通过!', {icon: 3, title:'提示'}, function(index){
|
||||
layer.close(index);
|
||||
examineResult({ id:data.id,type: 'pass' });
|
||||
});
|
||||
}
|
||||
// 审核 - 驳回
|
||||
function examineReject(data){
|
||||
layer.prompt({
|
||||
formType: 2,
|
||||
value: '',
|
||||
title: '请输入驳回原因',
|
||||
area: ['800px', '350px'] //自定义文本域宽高
|
||||
}, function(value, index, elem){
|
||||
layer.close(index);
|
||||
examineResult({ id:data.id,type: 'reject',cause: value });
|
||||
});
|
||||
}
|
||||
// 审核 - 结果提交
|
||||
function examineResult(data){
|
||||
if(repeat_flag) return;
|
||||
repeat_flag = true;
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
dataType: 'JSON',
|
||||
url: ns.url("fenxiao://shop/fenxiao/upgradeExamine"),
|
||||
data: data,
|
||||
async: false,
|
||||
success: function(res){
|
||||
repeat_flag = false;
|
||||
layer.msg(res.message);
|
||||
if (parseInt(res.code) === 0) table.reload();
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
{/block}
|
||||
|
|
@ -306,7 +306,7 @@
|
|||
});
|
||||
});
|
||||
|
||||
// 是否参与分销 is_fenxiao
|
||||
// 是否参与分销
|
||||
form.on("radio(is_fenxiao)", function (data) {
|
||||
if (data.value == 1) {
|
||||
$("#fenxiao_type,#fenxiao_price,#default_rule").removeClass("layui-hide");
|
||||
|
|
|
|||
|
|
@ -1,9 +1,6 @@
|
|||
{extend name="app/shop/view/base.html"/}
|
||||
{block name="resources"}
|
||||
<style>
|
||||
.good-name, .good-price {
|
||||
line-height: 34px;
|
||||
}
|
||||
.align-right {text-align: right;}
|
||||
</style>
|
||||
{/block}
|
||||
|
|
|
|||
|
|
@ -1,10 +1,5 @@
|
|||
{extend name="app/shop/view/base.html"/}
|
||||
{block name="resources"}
|
||||
<style>
|
||||
.layui-table-header {overflow: initial;}
|
||||
.layui-table-header .layui-table-cell {overflow: initial;}
|
||||
.layui-layout-admin.admin-style-2 .table-tab{margin-top: 0;}
|
||||
</style>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<div class="screen layui-collapse" lay-filter="selection_panel">
|
||||
|
|
@ -120,11 +115,6 @@
|
|||
<button class="layui-btn layui-btn-primary" lay-event="cancel">不参与</button>
|
||||
</script>
|
||||
|
||||
<!-- 批量操作 -->
|
||||
<script type="text/html" id="toolbarOperation">
|
||||
<button class="layui-btn layui-btn-primary" lay-event="join">参与</button>
|
||||
<button class="layui-btn layui-btn-primary" lay-event="cancel">不参与</button>
|
||||
</script>
|
||||
<!-- 批量操作 -->
|
||||
<script type="text/html" id="batchOperation">
|
||||
<button class="layui-btn layui-btn-primary" lay-event="join">参与</button>
|
||||
|
|
|
|||
|
|
@ -23,14 +23,14 @@
|
|||
<div class="layui-input-block weight-list">
|
||||
<span value="1" class="{if in_array(1, $level_weight)}disabled{/if}">一级</span>
|
||||
<span value="2" class="{if in_array(2, $level_weight)}disabled{/if}">二级</span>
|
||||
<!--<span value="3" class="{if in_array(3, $level_weight)}disabled{/if}">三级</span>-->
|
||||
<!--<span value="4" class="{if in_array(4, $level_weight)}disabled{/if}">四级</span>-->
|
||||
<!--<span value="5" class="{if in_array(5, $level_weight)}disabled{/if}">五级</span>-->
|
||||
<!--<span value="6" class="{if in_array(6, $level_weight)}disabled{/if}">六级</span>-->
|
||||
<!--<span value="7" class="{if in_array(7, $level_weight)}disabled{/if}">七级</span>-->
|
||||
<!--<span value="8" class="{if in_array(8, $level_weight)}disabled{/if}">八级</span>-->
|
||||
<!--<span value="9" class="{if in_array(9, $level_weight)}disabled{/if}">九级</span>-->
|
||||
<!--<span value="10" class="{if in_array(10, $level_weight)}disabled{/if}">十级</span>-->
|
||||
<span value="3" class="{if in_array(3, $level_weight)}disabled{/if}">三级</span>
|
||||
<span value="4" class="{if in_array(4, $level_weight)}disabled{/if}">四级</span>
|
||||
<span value="5" class="{if in_array(5, $level_weight)}disabled{/if}">五级</span>
|
||||
<span value="6" class="{if in_array(6, $level_weight)}disabled{/if}">六级</span>
|
||||
<span value="7" class="{if in_array(7, $level_weight)}disabled{/if}">七级</span>
|
||||
<span value="8" class="{if in_array(8, $level_weight)}disabled{/if}">八级</span>
|
||||
<span value="9" class="{if in_array(9, $level_weight)}disabled{/if}">九级</span>
|
||||
<span value="10" class="{if in_array(10, $level_weight)}disabled{/if}">十级</span>
|
||||
</div>
|
||||
<div class="word-aux">
|
||||
<p>等级权重越大等级越高</p>
|
||||
|
|
@ -127,11 +127,10 @@
|
|||
<div class="layui-input-block">
|
||||
<input type="radio" name="upgrade_type" value="1" lay-filter="withdraw_type" title="满足以下任意条件" checked />
|
||||
<input type="radio" name="upgrade_type" value="2" lay-filter="withdraw_type" title="满足以下全部条件" />
|
||||
<input type="radio" name="upgrade_type" value="3" lay-filter="withdraw_type" title="不可升级" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item upgrade_where">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"></label>
|
||||
<div class="layui-input-block">
|
||||
<!-- <button class="layui-btn layui-btn-primary level-btn">分销订单总额<input type="hidden" value="2" /></button> -->
|
||||
|
|
@ -150,7 +149,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-card card-common card-brief upgrade_where">
|
||||
<div class="layui-card card-common card-brief">
|
||||
<div class="layui-card-header">
|
||||
<span class="card-title">升级条件限制</span>
|
||||
</div>
|
||||
|
|
@ -253,14 +252,14 @@
|
|||
<div class="layui-form-mid">人</div>
|
||||
<a href="#" class="text-color layui-form-mid" onclick="delDiv(this)">删除</a>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<button class="layui-btn" lay-submit lay-filter="save">保存</button>
|
||||
<button class="layui-btn layui-btn-primary" onclick="back()">返回</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="form-row">
|
||||
<button class="layui-btn" lay-submit lay-filter="save">保存</button>
|
||||
<button class="layui-btn layui-btn-primary" onclick="back()">返回</button>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{block name="script"}
|
||||
|
|
@ -303,7 +302,7 @@
|
|||
layer.msg('请选择等级权重');
|
||||
return;
|
||||
}
|
||||
if(arr==arr1 && data.field.upgrade_type != 3){
|
||||
if(arr==arr1){
|
||||
layer.msg('请选择升级条件');
|
||||
return;
|
||||
}
|
||||
|
|
@ -369,13 +368,6 @@
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 监听:升级方式 改变
|
||||
form.on("radio(withdraw_type)", function(data){
|
||||
if(parseInt(data.value) === 3) $(".upgrade_where").hide();
|
||||
else $(".upgrade_where").show();
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function delDiv(e) {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
.weight-list span.active{border-color: #ff8143;}
|
||||
.weight-list span.disabled{background:#f1f1f1;cursor: not-allowed; }
|
||||
.layui-btn.layui-btn-primary.level-btn span{margin-left: 5px}
|
||||
.hide{display: none}
|
||||
</style>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
|
|
@ -26,14 +25,14 @@
|
|||
<div class="layui-input-block weight-list">
|
||||
<span value="1" class="{if $info.level_num eq 1}active{/if} {if in_array(1, $level_weight)}disabled{/if}">一级</span>
|
||||
<span value="2" class="{if $info.level_num eq 2}active{/if} {if in_array(2, $level_weight)}disabled{/if}">二级</span>
|
||||
<!--<span value="3" class="{if $info.level_num eq 3}active{/if} {if in_array(3, $level_weight)}disabled{/if}">三级</span>-->
|
||||
<!--<span value="4" class="{if $info.level_num eq 4}active{/if} {if in_array(4, $level_weight)}disabled{/if}">四级</span>-->
|
||||
<!--<span value="5" class="{if $info.level_num eq 5}active{/if} {if in_array(5, $level_weight)}disabled{/if}">五级</span>-->
|
||||
<!--<span value="6" class="{if $info.level_num eq 6}active{/if} {if in_array(6, $level_weight)}disabled{/if}">六级</span>-->
|
||||
<!--<span value="7" class="{if $info.level_num eq 7}active{/if} {if in_array(7, $level_weight)}disabled{/if}">七级</span>-->
|
||||
<!--<span value="8" class="{if $info.level_num eq 8}active{/if} {if in_array(8, $level_weight)}disabled{/if}">八级</span>-->
|
||||
<!--<span value="9" class="{if $info.level_num eq 9}active{/if} {if in_array(9, $level_weight)}disabled{/if}">九级</span>-->
|
||||
<!--<span value="10" class="{if $info.level_num eq 10}active{/if} {if in_array(10, $level_weight)}disabled{/if}">十级</span>-->
|
||||
<span value="3" class="{if $info.level_num eq 3}active{/if} {if in_array(3, $level_weight)}disabled{/if}">三级</span>
|
||||
<span value="4" class="{if $info.level_num eq 4}active{/if} {if in_array(4, $level_weight)}disabled{/if}">四级</span>
|
||||
<span value="5" class="{if $info.level_num eq 5}active{/if} {if in_array(5, $level_weight)}disabled{/if}">五级</span>
|
||||
<span value="6" class="{if $info.level_num eq 6}active{/if} {if in_array(6, $level_weight)}disabled{/if}">六级</span>
|
||||
<span value="7" class="{if $info.level_num eq 7}active{/if} {if in_array(7, $level_weight)}disabled{/if}">七级</span>
|
||||
<span value="8" class="{if $info.level_num eq 8}active{/if} {if in_array(8, $level_weight)}disabled{/if}">八级</span>
|
||||
<span value="9" class="{if $info.level_num eq 9}active{/if} {if in_array(9, $level_weight)}disabled{/if}">九级</span>
|
||||
<span value="10" class="{if $info.level_num eq 10}active{/if} {if in_array(10, $level_weight)}disabled{/if}">十级</span>
|
||||
</div>
|
||||
<div class="word-aux">
|
||||
<p>等级权重越大等级越高</p>
|
||||
|
|
@ -129,11 +128,10 @@
|
|||
<div class="layui-input-block">
|
||||
<input type="radio" name="upgrade_type" value="1" lay-filter="withdraw_type" title="满足以下任意条件" checked />
|
||||
<input type="radio" name="upgrade_type" value="2" lay-filter="withdraw_type" {if $info.upgrade_type == 2} checked {/if} title="满足以下全部条件" />
|
||||
<input type="radio" name="upgrade_type" value="3" lay-filter="withdraw_type" {if $info.upgrade_type == 3} checked {/if} title="不可升级" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-form-item upgrade_where {if $info.upgrade_type == 3}hide{/if}">
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label"></label>
|
||||
<div class="layui-input-block">
|
||||
<!-- <button class="layui-btn layui-btn-primary level-btn {if $info.fenxiao_order_num > 0}border-color{/if}">分销订单总数<input type="hidden" value="1" /></button>
|
||||
|
|
@ -152,7 +150,7 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-card card-common card-brief upgrade_where {if $info.upgrade_type == 3}hide{/if}">
|
||||
<div class="layui-card card-common card-brief">
|
||||
<div class="layui-card-header">
|
||||
<span class="card-title">升级条件限制</span>
|
||||
</div>
|
||||
|
|
@ -256,14 +254,22 @@
|
|||
<div class="layui-form-mid">人</div>
|
||||
<a href="#" class="text-color layui-form-mid" onclick="delDiv(this)">删除</a>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<input type="hidden" name="level_id" value="{$info.level_id}">
|
||||
<button class="layui-btn" lay-submit lay-filter="save">保存</button>
|
||||
<button class="layui-btn layui-btn-primary" onclick="back()">返回</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{else/}
|
||||
<div class="form-row">
|
||||
<input type="hidden" name="level_id" value="{$info.level_id}">
|
||||
<button class="layui-btn" lay-submit lay-filter="save">保存</button>
|
||||
<button class="layui-btn layui-btn-primary" onclick="back()">返回</button>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
</div>
|
||||
{/block}
|
||||
{block name="script"}
|
||||
|
|
@ -309,7 +315,7 @@
|
|||
layer.msg('请选择等级权重');
|
||||
return;
|
||||
}
|
||||
if(arr==arr1 && data.field.upgrade_type != 3){
|
||||
if(arr==arr1){
|
||||
layer.msg('请选择升级条件');
|
||||
return;
|
||||
}
|
||||
|
|
@ -376,12 +382,6 @@
|
|||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 监听:升级方式 改变
|
||||
form.on("radio(withdraw_type)", function(data){
|
||||
if(parseInt(data.value) === 3) $(".upgrade_where").hide();
|
||||
else $(".upgrade_where").show();
|
||||
});
|
||||
});
|
||||
|
||||
function delDiv(e) {
|
||||
|
|
|
|||
|
|
@ -136,8 +136,6 @@
|
|||
upgrade_content += data.order_money == 0 ? '' : '自购订单总额大于' + data.order_money + ' 并且 ';
|
||||
upgrade_content += data.one_child_num == 0 ? '' : '下线人数大于' + data.one_child_num + ' 并且 ';
|
||||
upgrade_content += data.one_child_fenxiao_num == 0 ? '' : '下线分销商人数大于' + data.one_child_fenxiao_num + ' 并且 ';
|
||||
}else if(data.upgrade_type == 3){
|
||||
upgrade_content += '不可升级';
|
||||
}
|
||||
var upgrade_content = upgrade_content.replace(/ 或者 $/g,"");
|
||||
var upgrade_content = upgrade_content.replace(/ 并且 $/g,"");
|
||||
|
|
|
|||
|
|
@ -126,7 +126,7 @@
|
|||
<col width="15%">
|
||||
</colgroup>
|
||||
<tr>
|
||||
<th lay-data="{field:'product_name', width:200}">商品信息</th>
|
||||
<th>商品信息</th>
|
||||
<th style="text-align:right">单价(元) / 数量</th>
|
||||
<th>分佣信息</th>
|
||||
<th>佣金状态</th>
|
||||
|
|
@ -141,7 +141,7 @@
|
|||
<img layer-src src="{:img($order_goods_item.sku_image, 'small')}">
|
||||
</div>
|
||||
<div class="info">
|
||||
<a href="" target="_blank" title="{$order_goods_item.sku_name}" class="multi-line-hiding text-color">{$order_goods_item.sku_name}</a>
|
||||
<span title="{$order_goods_item.sku_name}" class="multi-line-hiding text-color">{$order_goods_item.sku_name}</span>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,6 @@
|
|||
{extend name="app/shop/view/base.html"/}
|
||||
{block name="resources"}
|
||||
<link rel="stylesheet" href="FENXIAO_CSS/order_list.css">
|
||||
<style>
|
||||
.layui-table-view {margin-top: 15px;}
|
||||
</style>
|
||||
{/block}
|
||||
{block name="main"}
|
||||
<!-- 筛选面板 -->
|
||||
|
|
@ -75,7 +72,6 @@
|
|||
<script src="FENXIAO_JS/order_list.js"></script>
|
||||
<script>
|
||||
var laypage,element, form, hash_url;
|
||||
var is_refresh = false;
|
||||
var orderDataAll = [];
|
||||
|
||||
/**
|
||||
|
|
@ -100,7 +96,6 @@
|
|||
//从hash中获取数据
|
||||
function getHashData(){
|
||||
var hash = ns.urlReplace(location.hash);
|
||||
var data= [];
|
||||
|
||||
var hash_arr = hash.split("&");
|
||||
|
||||
|
|
@ -154,7 +149,6 @@
|
|||
|
||||
//监听筛选事件
|
||||
form.on('submit(search)', function(data){
|
||||
is_refresh = true;
|
||||
data.field.page = 1;
|
||||
setHashOrderList(data.field);
|
||||
//getOrderList(data.field);
|
||||
|
|
@ -168,16 +162,6 @@
|
|||
}else{
|
||||
location.href = ns.url("fenxiao://shop/order/exportorder",data.field);
|
||||
}
|
||||
|
||||
/*$.ajax({
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
url: ns.url("fenxiao://shop/order/exportorder"),
|
||||
data: data.field,
|
||||
success: function (res) {
|
||||
|
||||
}
|
||||
})*/
|
||||
return false;
|
||||
});
|
||||
|
||||
|
|
@ -238,7 +222,6 @@
|
|||
getOrderId();
|
||||
});
|
||||
|
||||
|
||||
//获取选中的id
|
||||
function getOrderId(){
|
||||
var lists = $(".sub-selected-checkbox input:checked");
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
.layui-table {margin-top: 15px;}
|
||||
.layui-table thead tr {background-color: #F8F6F9;}
|
||||
.layui-table th {border-width: 0; font-size: 14px!important;}
|
||||
.layui-table td {padding: 12px 15px;}
|
||||
.layui-table td {padding: 8px 15px;}
|
||||
.layui-table-cell {height: 32px; line-height: 32px;font-size: 12px;}
|
||||
.layui-table .header-row {border-top: 1px solid #e6e6e6;background: #f7f7f7;}
|
||||
.layui-table .header-row:hover{background: #f7f7f7;}
|
||||
|
|
@ -13,11 +13,13 @@
|
|||
/* .layui-layout-admin .layui-body{min-width:1100px} */
|
||||
/*.date-picker-btn.selected{background-color:#0d73f9;color:#fff}*/
|
||||
.layui-table td,.layui-table th,.layui-table-fixed-r,.layui-table-header,.layui-table-page,.layui-table-tips-main,.layui-table-tool,.layui-table-view,.layui-table[lay-skin=line],.layui-table[lay-skin=row]{border-color:#f1f1f1 !important;}
|
||||
.layui-table thead th{border-bottom:none}
|
||||
.layui-table thead th{border-bottom:none;padding-left:0;padding-right:0;}
|
||||
.order-list-table .separation-row td{padding:10px 20px;border: 0;}
|
||||
.order-list-table .separation-row:hover{background-color: #fff;}
|
||||
.order-list-table .remark-row{background: #FFF9DF!important;color: #D09B4C;}
|
||||
.order-list-table .remark-row td {padding: 5px 10px;}
|
||||
.order-list-table .remark-row:hover{background: #FFF9DF!important}
|
||||
.order-list-table .remark-row td {padding: 3px 10px!important;}
|
||||
.order-list-table .header-row td{padding: 3px 15px!important;}
|
||||
.order-list-table .header-row td:nth-child(1){border-right: 0;}
|
||||
.order-list-table .header-row td:nth-child(2){text-align:center;border-left: 0;}
|
||||
.order-list-table .header-row span{vertical-align:middle}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,6 @@
|
|||
.layui-card-body .content{width: 33.3%;display: flex;flex-direction: column;margin-bottom: 30px;justify-content: center;}
|
||||
.layui-card-body .content .title{color: #909399;font-size: 14px;}
|
||||
.layui-card-body .money{color: #303133;font-size: 26px;margin-top: 10px;max-width: 250px;}
|
||||
.layui-card-body .bottom-title{color: #909399;font-size: 14px;margin-top: 5px;}
|
||||
.layui-layout-admin.admin-style-2 .screen{margin-bottom: 15px;}
|
||||
.member-table{cursor: pointer;}
|
||||
</style>
|
||||
|
|
|
|||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue