批發市場 : 建立分銷商、供應商關系
建立關系流程:批發市場申請成為分銷商 -> 供應商同意 -> 成為分銷商
一、申請成為分銷商(供應商不能是分銷商)
文件路徑:shop/controllers/Supplier/GoodsCtl.php
視圖:shop/views/default/Supplier/GoodsCtl/goodslist.php
~~~
<a class="apply_dist" data-id = <?=$val['shop_id']?> style="padding: 3.5px 50px;background-color: #e45050;color: white;"><?=__('申請分銷商')?></a>
$(".apply_dist").click(function (){
var self_shop_type = <?=$shop_info['shop_type']?>;
var shop_id = $(this).attr("data-id");
if(self_shop_type == 2){
Public.tips.error("<?=__('供貨商不能參與分銷')?>!");
}else{
location.href = SITE_URL+"?ctl=Seller_Supplier_Supplier&met=apply&typ=e&shop_id="+shop_id;
}
})
~~~
申請路徑:shop/controllers/Seller/Supplier/SupplierCtl.php
申請視圖:shop/views/default/Seller/Supplier/SupplierCtl/apply.php
參數:shop_id
方法:apply()
~~~
if($shop_id)
{
$shop_info = $shopBaseModel->getOneByWhere(array('shop_id'=>$shop_id));
$cat_row['shop_id'] = $shop_id;
$shop_cat = $shopGoodCatModel->getGoodCatList($cat_row, array());
}
~~~
二、供應商審核分銷商
文件路徑:shop/controllers/Seller/Supplier/DistributorCtl.php
視圖:shop/views/default/Seller/Supplier/DistributorCtl/index.php
* 審核通過:方法:edit_statu()
~~~
if(request_string('act') && request_string('act') == 'agree')
{
$field_row['distributor_enable'] = 1;
$field_row['distributor_cat_ids'] = $shop_dist_base['distributor_new_cat_ids'];
$field_row['distributor_new_cat_ids'] = '';
$flag=$this->shopDistributorModel->editShopDistributor($shop_distributor_id,$field_row);
//發送消息
$MessageModel->sendMessage('dist apply statu',$dist_shop_base['user_id'], $dist_shop_base['user_name'], $order_id = NULL, $shop_name=null, 1, 1, $end_time = Null,$common_id=null);
}
elseif(request_string('act') && request_string('act') == 'del')
{
$flag=$this->shopDistributorModel->removeShopDistributor($shop_distributor_id);
//刪除分銷商品
$goodsCommonModel = new Goods_CommonModel();
$commons =$goodsCommonModel -> getByWhere(array('shop_id'=>$dist_shop_base['shop_id'],'supply_shop_id'=>Perm::$shopId));
if(!empty($commons))
{
foreach ($commons as $key => $value) {
$goodsCommonModel->removeCommon($value['common_id']);
//發送消息
$des = '供貨商刪除你的分銷權限';
$MessageModel->sendMessage('del goods',$dist_shop_base['user_id'], $dist_shop_base['user_name'], $order_id = NULL, $shop_name=null, 1, 1, $end_time = Null,$value['common_id'],$goods_id=null,$des);
}
}
}
~~~
* 分銷商審核不通過:
視圖:shop/views/default/Seller/Supplier/DistributorCtl/index.php
~~~
<div id="apply-disagree" class="eject_con" >
<input type="hidden" name="shop_grade_id" id="shop_grade_id" value="" />
<textarea id="reason"></textarea>
<div class="eject_con mb10">
<div class="bottom"><a id="btn_apply_submit" class="button bbc_seller_submit_btns" href="javascript:void(0);"><?=__('提交')?></a></div>
</div>
</div>
$("#btn_apply_submit").click(function (){
var shop_distributor_id = $("#shop_distributor_id").val();
var reason = $("#reason").val();
if(reason.length == 0){
Public.tips.error('<?=__('請填寫原因!')?>');
return false;
}
var ajax_url = './index.php?ctl=Seller_Supplier_Distributor&met=apply_disagree&typ=json';
$.ajax({
url:ajax_url,
data:{shop_distributor_id:shop_distributor_id,reason:reason},
success:function(a){
. . .
}
})
})
~~~
方法:apply_disagree()
~~~
//不通過分銷商申請,添加原因
$flag = $this->shopDistributorModel->editShopDistributor($shop_distributor_id,$field_row);
~~~
- 序言
- 系統要求
- 版本更新日志
- 遠豐商城技術對接說明
- 開發指導
- 系統架構
- 負載集群
- 云存儲
- 框架內容
- 基礎
- 開發規范
- 目錄結構
- 架構
- 架構總覽
- 數據庫
- 數據庫連接
- 基本使用
- 緩存
- 配置
- 路由
- 數據字典
- ucenter
- shop
- paycenter
- ucenter_admin
- shop_admin
- paycenter_admin
- shop1
- shop2
- shop3
- 通訊內容
- 商家中心
- 頂部導航欄
- 店鋪信息欄
- 店鋪及商品提示欄
- 交易提示欄
- 銷售情況統計欄
- 集群架構圖
- 單品銷量排行欄
- 店鋪運營推廣欄
- 平臺聯系方式欄
- 訂單物流
- 商品
- 商品列表
- 商品詳情
- 商品發布與編輯
- 分銷商品
- 關聯版式
- 商品規格
- 圖片空間
- 淘寶導入
- 訂單流程
- 交易訂單
- 訂單退款/退貨
- 促銷
- 團購管理
- 加價購
- 限時折扣
- 滿即送
- 代金券管理
- 分銷
- 店鋪
- 店鋪設置
- 自銷產品供應商
- 實體店鋪
- 品牌申請
- 店鋪信息
- 消費者保障服務
- 門店賬號
- 分銷商--產品供應商
- 分銷明細
- 批發市場
- 商家微信公眾號
- 售后服務
- 咨詢管理
- 投訴管理
- 退款管理
- 退貨管理
- 雜項
- 遠程上傳圖片
- 接口(廢棄,參考最外層接口項)
- 接口說明
- 品牌
- 商品規格
- 商品類型
- 商品分類
- 商品
- 訂單
- 商品/店鋪收藏
- 足跡
- 退款及退貨
- 商家店鋪
- 會員
- 入駐協議
- 訂單接口
- 商品接口
- 訂單物流接口
- 商家中心接口
- 促銷接口
- 快遞鳥物流接口
- 代金券接口
- 首頁版塊
- 團購
- 平臺紅包
- 限時折扣接口
- 拼團接口
- wap首頁模板
- JS
- 銀聯支付
- 多語言
- 商品評分
- 圖片加載
- 買家申請退款退貨
- 商家退款退貨
- 平臺退款退貨
- 添加發票
- 提交訂單
- 確認訂單
- 運費銷售區域
- 獲取會員地址
- 充值
- 導出XLS
- 商城系統集成
- 多語言實現
- 三級分銷推廣鏈接發展推廣員
- app.ini.php
- 去分銷
- 版本更新
- 物流支持
- 運營人員建議
- 業務邏輯
- 統計結算
- 客服消息
- 賬號
- 三級分銷
- IM
- 配置
- 平臺帳號
- 活動數據表說明
- 接口
- 數據庫中間鍵
- MyCat的優勢
- 概念說明
- Mycat的下載及安裝
- 參數配置案列
- Mycat讀寫分離
- 基本命令
- 常見錯誤