<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                :-: **分銷員(非供應商用戶)** 分銷前提:在相應店鋪購買過商品,且滿足對應店鋪申請成為分銷員的條件 分銷流程:分銷中心申請分銷 -> 店鋪審核 -> 分銷 一、申請分銷 文件路徑:shop/controllers/Distribution/Buyer/DirectsellerCtl.php 視圖:shop/views/default/Distribution/Buyer/DirectsellerCtl/index.php ~~~ <!---滿足申請條件--> <a onclick="apply('<?=$val['shop_id']?>')" class="to_views bbc_btns "><i class="iconfont icon-duigou1"></i><?=__('申請分銷')?></a> <script> function apply(id) { var e = $(this); $.dialog.confirm("<?=__('您確定要申請嗎?')?>",function() { $.post(SITE_URL + '?ctl=Distribution_Buyer_Directseller&met=addDirectseller&typ=json',{shop_id:id},function(d) { if(d.status == 200) { var data = d.data; Public.tips.success("<?=__('申請成功!')?>"); location.href = SITE_URL + '?ctl=Distribution_Buyer_Directseller&met=index'; } else { Public.tips.error("<?=__('申請失敗!')?>"); location.href = SITE_URL + '?ctl=Distribution_Buyer_Directseller&met=index'; } }); }); }; </script> ~~~ 方法:addDirectseller() ~~~ // 添加店鋪分銷員 $flag = $this->directseller_model->addDirectseller($data); ~~~ 二、供應商發布商品 文件路徑:shop/controllers/Distribution/Seller/SettingCtl.php 視圖:shop/views/default/Distribution/Seller/SettingCtl/addDirectsellerGoods.php 提交商品表單驗證:`$('#form').validator({})` 方法:addGoods() ~~~ //新增分銷商品 if($common_id_rows) { $Goods_CommonModel = new Goods_CommonModel(); foreach($common_id_rows as $k => $v) { //三級分傭 $common_data['common_cps_rate'] = request_float('common_cps_rate'); //一級分傭比例 $common_data['common_second_cps_rate'] = request_float('common_second_cps_rate'); //二級分傭比例 $common_data['common_third_cps_rate'] = request_float('common_third_cps_rate'); //三級分傭比例 $common_data['common_is_directseller'] = 1; $common = $Goods_CommonModel->getOne($v); $common_data['common_cps_commission'] = number_format((request_float('common_cps_rate')*$common['common_price']/100), 2, '.', ''); $flag = $Goods_CommonModel->editCommon($v, $common_data); } } ~~~ 三、分銷商品 文件路徑:shop/controllers/Distribution/Buyer/GoodsCtl.php 視圖:shop/views/default/Distribution/Buyer/GoodsCtl/index.php 分享推廣: ~~~ <a data-param='<?php echo urlencode(Yf_Registry::get('base_url').'/shop/api/share.php?type=goods&gid='.$goods_id.'&rec='.$rec); ?>' data-url='<?php echo Yf_Registry::get('base_url').'/shop/api/share.php?type=goods&gid='.$goods_id.'&rec='.$rec; ?>' onclick="showLink(this);"><i class="iconfont icon-chakan"></i><?=__('分享')?></a> //分享鏈接 function showLink(ele) { $('#dialog_link').yf_show_dialog({width: 550, title: "<?=__('分享鏈接')?>"}); var val = ele.getAttribute('data-url'); $('#share-link').val(val); var param = ele.getAttribute("data-param"); var img = '<?=Yf_Registry::get('base_url')?>'+'/shop/api/qrcode.php?data='+param+''; $('#share_code').attr('src',img); } ~~~ 四、店鋪分銷管理 文件路徑:shop/controllers/Distribution/Seller/SettingCtl.php * 分銷設置 視圖:shop/views/default/Distribution/Seller/SettingCtl/index.php 設置消費金額限制表單提交:`$('#form').validator({})` 方法:edit() ~~~ $temp = $this->Distribution_ShopDirectsellerConfigModel->getConfigList(array('shop_id'=>$shop_id)); if(!empty($temp)) { $flag = $this->Distribution_ShopDirectsellerConfigModel->updateConfig($shop_id,$edit_directseller_row); }else{ $edit_directseller_row['shop_id'] = $shop_id; $flag = $this->Distribution_ShopDirectsellerConfigModel->addConfig($edit_directseller_row); } ~~~ * 我的分銷員 (1)分銷員列表: 視圖:shop/views/default/Distribution/Seller/SettingCtl/directseller.php 方法:directseller() ~~~ //獲取店鋪分銷員 $Yf_Page = new Yf_Page(); $Yf_Page->listRows = 15; $rows = $Yf_Page->listRows; $offset = request_int('firstRow', 0); $page = ceil_r($offset / $rows); $data = $Distribution_ShopDirectsellerModel->getDirectseller($cond_row,$order_row,$page,$rows); ~~~ (2)分銷員審核通過 方法:directseller() ~~~ <span <?php if($val['directseller_enable']){?>class="unclick"<?php } ?>> <a href="javascript:void(0);" data-id='<?=$val['shop_directseller_id']?>' <?php if(!$val['directseller_enable']){ echo 'class="audit"';}?>><i class="iconfont icon-success"></i><?=__('通過')?></a> </span> $(".audit").click(function(){ var id = $(this).attr('data-id'); $.ajax({ url: ajax_url, data:{id:id,op:'audit'}, success:function(a){ if(a.status == 200) { Public.tips.success("<?=__('操作成功!')?>"); location.href = SITE_URL + '?ctl=Distribution_Seller_Setting&met=directseller&typ=e'; } else { Public.tips.error("<?=__('操作失敗!')?>"); } } }); }); ~~~ ~~~ if(request_string('op')=='audit') { $id = request_int('id'); $field_row['directseller_enable'] = 1; $flag = $Distribution_ShopDirectsellerModel->editBase($id,$field_row); if ($flag === FALSE) { $status = 250; $msg = __('failure'); } else { $status = 200; $msg = __('success'); } $data = array(); $this->data->addBody(-140, $data, $msg, $status); } ~~~ (3)刪除分銷員 方法:delDirectseller() ~~~ <span class="del"> <a data-param="{'ctl':'Distribution_Seller_Setting','met':'delDirectseller','id':'<?=$val['shop_directseller_id']?>'}" href="javascript:void(0)"><i class="iconfont icon-lajitong"></i><?=__('刪除')?></a> </span> ~~~ ~~~ //判斷刪除操作是不是當前店鋪 if ($directseller['shop_id'] == $shop_id) { $flag = $Distribution_ShopDirectsellerModel->removeShopDirectseller($shop_directseller_id); if ($flag) { $status = 200; $msg = __('success'); } else { $status = 250; $msg = __('failure'); } } ~~~ * 分銷商品 (1)分銷商品列表 文件路徑:shop/controllers/Distribution/Seller/SettingCtl.php 視圖:shop/views/default/Distribution/Seller/SettingCtl/directsellerGoods.php `$data = $Goods_CommonModel->getGoodsList($cond_row,array('common_id' => 'DESC'), $page, $rows);` (2)刪除分銷商品 文件路徑:shop/controllers/Seller/GoodsCtl.php 方法:deleteGoodsCommon() ~~~ <span class="del"> <a data-param="{'id':'<?= $item['common_id'] ?>','ctl':'Seller_Goods','met':'deleteGoodsCommon'}" href="javascript:void(0)"><i class="iconfont icon-lajitong"></i><?=__('刪除')?></a> </span> ~~~ ~~~ //刪除分銷商的商品 $dist_common = $this->goodsCommonModel->getByWhere(array('common_parent_id' => $id)); if(!empty($dist_common)){ foreach ($dist_common as $key => $value) { $common_base = $this->goodsCommonModel->getOne($value['common_id']); $shop_base = $this->shopBaseModel->getOne($common_base['shop_id']); $this->goodsCommonModel->removeCommon($value['common_id']); //發送消息 $des = '供貨商刪除了該商品'; $MessageModel->sendMessage('del goods',$shop_base['user_id'], $shop_base['user_name'], $order_id = NULL, $shop_name=null, 1, 1, $end_time = Null,$common_base['common_id'],$goods_id=null,$des); } } ~~~ (3)設置分傭比例 視圖:shop/views/default/Distribution/Seller/SettingCtl/directsellerGoods.php 方法:editDirectsellerGoods() ~~~ <span class="edit"> <a href="javascript:void(0)" common-id='<?=$item['common_id']?>' first_rate='<?=$item['common_cps_rate']?>' second_rate='<?=$item['common_second_cps_rate']?>' third_rate='<?=$item['common_third_cps_rate']?>' id="set_commission"><i class="iconfont icon-setting"></i><?=__('設置')?></a> </span> //設置分傭比例 $('.table-list-style').on('click', '#set_commission', function() { var common_id = $(this).attr('common-id'); $('#common_id').val(common_id); var first_rate = $(this).attr('first_rate'); $('#common_cps_rate').val(first_rate); var second_rate = $(this).attr('second_rate'); $('#common_second_cps_rate').val(second_rate); var third_rate = $(this).attr('third_rate'); $('#common_third_cps_rate').val(third_rate); $('#dialog_directseller').yf_show_dialog({width: 450, title: "<?=__('設置分傭比例')?>"}); }); ~~~ ~~~ //三級分傭 $common_data['common_cps_rate'] = request_float('common_cps_rate'); //一級分傭比例 $common_data['common_second_cps_rate'] = request_float('common_second_cps_rate'); //二級分傭比例 $common_data['common_third_cps_rate'] = request_float('common_third_cps_rate'); //三級分傭比例 $common_data['common_is_directseller'] = 1; $common = $Goods_CommonModel->getOne($common_id); $common_data['common_cps_commission'] = number_format((request_float('common_cps_rate')*$common['common_price']/100), 2, '.', ''); $flag = $Goods_CommonModel->editCommon($common_id, $common_data); ~~~ * 添加分銷商品 文件路徑:shop/controllers/Distribution/Seller/SettingCtl.php 視圖:shop/views/default/Distribution/Seller/SettingCtl/addDirectsellerGoods.php 提交商品表單驗證:`$('#form').validator({})` 方法:addGoods() ~~~ //新增分銷商品 if($common_id_rows) { $Goods_CommonModel = new Goods_CommonModel(); foreach($common_id_rows as $k => $v) { //三級分傭 $common_data['common_cps_rate'] = request_float('common_cps_rate'); //一級分傭比例 $common_data['common_second_cps_rate'] = request_float('common_second_cps_rate'); //二級分傭比例 $common_data['common_third_cps_rate'] = request_float('common_third_cps_rate'); //三級分傭比例 $common_data['common_is_directseller'] = 1; $common = $Goods_CommonModel->getOne($v); $common_data['common_cps_commission'] = number_format((request_float('common_cps_rate')*$common['common_price']/100), 2, '.', ''); $flag = $Goods_CommonModel->editCommon($v, $common_data); } } ~~~ * 分銷業績列表 視圖:shop/views/default/Distribution/Seller/SettingCtl/directsellerDetail.php 方法:directsellerDetail() 模型:shop/models/Order/StateModel.php 分銷交易狀態: ~~~ foreach($data['items'] as $k=>$v) { switch ($v['order_status']) { case Order_StateModel::ORDER_WAIT_PAY : $data['items'][$k]['order_status_text'] = '訂單已經提交,等待買家付款'; break; case Order_StateModel::ORDER_PAYED : $data['items'][$k]['order_status_text'] = '已經付款'; break; case Order_StateModel::ORDER_WAIT_CONFIRM_GOODS : $data['items'][$k]['order_status_text'] = '已經發貨'; break; case Order_StateModel::ORDER_RECEIVED || Order_StateModel::ORDER_FINISH : $data['items'][$k]['order_status_text'] = '已經收貨'; break; case Order_StateModel::ORDER_CANCEL: $data['items'][$k]['order_status_text'] = '交易關閉'; break; } if ($v['order_shipping_fee'] == 0) { $data['items'][$k]['shipping_info'] = "(免運費)"; } else { $shipping_fee = @format_money($v['order_shipping_fee']); $data['items'][$k]['shipping_info'] = "(含運費$shipping_fee)"; } } ~~~ 五、分銷員分銷中心 1.分銷申請: 文件路徑:shop/controllers/Distribution/Buyer/DirectsellerCtl.php 視圖:shop/views/default/Distribution/Buyer/DirectsellerCtl/index.php ~~~ <!---滿足申請條件--> <a onclick="apply('<?=$val['shop_id']?>')" class="to_views bbc_btns "><i class="iconfont icon-duigou1"></i><?=__('申請分銷')?></a> <script> function apply(id) { var e = $(this); $.dialog.confirm("<?=__('您確定要申請嗎?')?>",function() { $.post(SITE_URL + '?ctl=Distribution_Buyer_Directseller&met=addDirectseller&typ=json',{shop_id:id},function(d) { if(d.status == 200) { var data = d.data; Public.tips.success("<?=__('申請成功!')?>"); location.href = SITE_URL + '?ctl=Distribution_Buyer_Directseller&met=index'; } else { Public.tips.error("<?=__('申請失敗!')?>"); location.href = SITE_URL + '?ctl=Distribution_Buyer_Directseller&met=index'; } }); }); }; </script> ~~~ 方法:addDirectseller() ~~~ // 添加店鋪分銷員 $flag = $this->directseller_model->addDirectseller($data); ~~~ 2.商品列表 文件路徑:shop/controllers/Distribution/Buyer/GoodsCtl.php 方法:index() ~~~ //獲取推廣商品 $data = array(); $Goods_CommonModel = new Goods_CommonModel(); $data = $Goods_CommonModel->getCommonList($cond_good_row,$order_row, $page, $rows); $data['user_id'] = Perm::$userId; ~~~ 3.我的推廣 文件路徑:shop/controllers/Distribution/Buyer/DirectsellerCtl.php 方法:directsellerList() ~~~ //分銷用戶下級列表 if(request_string('userName')) { $cond_row['user_name:LIKE'] = '%'.request_string('userName').'%'; } if(request_string('act')=='month') { $cond_row['user_regtime:<='] = get_date_time(); $beginDate = date('Y-m-d H:i:s',mktime(0,0,0,date('m'),1,date('Y'))); $cond_row['user_regtime:>='] = $beginDate; } $order_row['user_regtime'] = 'DESC'; $Yf_Page = new Yf_Page(); $Yf_Page->listRows = 15; $rows = $Yf_Page->listRows; $offset = request_int('firstRow', 0); $page = ceil_r($offset / $rows); $data = $this->directseller_model->getInvitors($cond_row,$order_row,$page,$rows); ~~~ 4.我的業績 文件路徑:shop/controllers/Distribution/Buyer/DirectsellerCtl.php 方法:directsellerOrder() 模型:shop/models/Order/StateModel.php ~~~ //用戶推廣訂單 $cond_row['order_status'] = Order_StateModel::ORDER_FINISH; $cond_row['directseller_id'] = Perm::$userId; $Order_BaseModel = new Order_BaseModel(); $data = $Order_BaseModel->getBaseList($cond_row, array('order_create_time' => 'DESC'), $page, $rows); ~~~ 訂單交易狀態: ~~~ //待付款 if ($status == 'wait_pay') { $cond_row['order_status'] = Order_StateModel::ORDER_WAIT_PAY; } //待發貨 -> 只可退款 if ($status == 'wait_perpare_goods') { $cond_row['order_status'] = Order_StateModel::ORDER_WAIT_PREPARE_GOODS; } //已付款 if ($status == 'order_payed') { $cond_row['order_status'] = Order_StateModel::ORDER_PAYED; } //待收貨、已發貨 -> 退款退貨 if ($status == 'wait_confirm_goods') { $cond_row['order_status'] = Order_StateModel::ORDER_WAIT_CONFIRM_GOODS; } //已完成 -> 訂單評價 if ($status == 'finish') { $cond_row['order_status'] = Order_StateModel::ORDER_FINISH; } //已取消 if ($status == 'cancel') { $cond_row['order_status'] = Order_StateModel::ORDER_CANCEL; } ~~~ 5.傭金記錄 文件路徑:shop/controllers/Distribution/Buyer/DirectsellerCtl.php 方法:directsellerCommission() ~~~ $cond_row['order_status'] = Order_StateModel::ORDER_FINISH; $Order_BaseModel = new Order_BaseModel(); $data = $Order_BaseModel->getBaseList($cond_row, array('order_create_time' => 'DESC'), $page, $rows); ~~~
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看