ThinkChat2.0新版上线,更智能更精彩,支持会话、画图、阅读、搜索等,送10W Token,即刻开启你的AI之旅 广告
# 分销商--产品供应商 **分销产品供应商(非供应商用户)** 文件路径:shop/controllers/Seller/Supplier/SupplierCtl.php 供应商审核状态: ``` <pre class="calibre14">``` <span class="token5">//审核状态</span> <span class="token2">if</span><span class="token1">(</span><span class="token3">request_int</span><span class="token1">(</span><span class="token4">'state'</span><span class="token1">)</span><span class="token">==</span><span class="token6">1</span><span class="token1">)</span> <span class="token1">{</span> $cond_row<span class="token1">[</span><span class="token4">'distributor_enable'</span><span class="token1">]</span> <span class="token">=</span><span class="token6">1</span><span class="token1">;</span> <span class="token5">//审核通过</span> <span class="token1">}</span><span class="token3">elseif</span><span class="token1">(</span><span class="token3">request_int</span><span class="token1">(</span><span class="token4">'state'</span><span class="token1">)</span><span class="token">==</span><span class="token6">2</span><span class="token1">)</span> <span class="token1">{</span> $cond_row<span class="token1">[</span><span class="token4">'distributor_enable'</span><span class="token1">]</span> <span class="token">=</span> <span class="token6">0</span><span class="token1">;</span> <span class="token5">//未审核</span> <span class="token1">}</span><span class="token3">elseif</span><span class="token1">(</span><span class="token3">request_int</span><span class="token1">(</span><span class="token4">'state'</span><span class="token1">)</span><span class="token">==</span><span class="token6">3</span><span class="token1">)</span> <span class="token1">{</span> $cond_row<span class="token1">[</span><span class="token4">'distributor_enable'</span><span class="token1">]</span> <span class="token">=</span><span class="token">-</span><span class="token6">1</span><span class="token1">;</span> <span class="token5">//审核未通过</span> <span class="token1">}</span> ``` ``` 一、我的供应商 1.供应商列表 控制器:shop/controllers/Seller/Supplier/SupplierCtl.php ->index() `$data = $this->shopDistributorModel->listByWhere($cond_row, $order_row, $page, $rows);` 视图:shop/views/default/Seller/Supplier/SupplierCtl/index.php 2.添加、编辑 方法:addSupplier() ``` <pre class="calibre14">``` <span class="token2">if</span><span class="token1">(</span><span class="token3">request_string</span><span class="token1">(</span><span class="token4">'act'</span><span class="token1">)</span> <span class="token">&&</span> <span class="token3">request_string</span><span class="token1">(</span><span class="token4">'act'</span><span class="token1">)</span> <span class="token">==</span> <span class="token4">"edit"</span><span class="token1">)</span> <span class="token1">{</span> $supplier_row<span class="token1">[</span><span class="token4">'distributor_new_cat_ids'</span><span class="token1">]</span> <span class="token">=</span> $cat_ids<span class="token1">;</span> $shop_distributor_id <span class="token">=</span> <span class="token3">request_string</span><span class="token1">(</span><span class="token4">'shop_distributor_id'</span><span class="token1">)</span><span class="token1">;</span> $flag <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>shopDistributorModel<span class="token">-</span><span class="token">></span><span class="token3">editShopDistributor</span><span class="token1">(</span>$shop_distributor_id<span class="token1">,</span>$supplier_row<span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span><span class="token2">else</span> <span class="token1">{</span> $supplier_row<span class="token1">[</span><span class="token4">'distributor_enable'</span><span class="token1">]</span> <span class="token">=</span> <span class="token6">0</span><span class="token1">;</span> $supplier_row<span class="token1">[</span><span class="token4">'distributor_new_cat_ids'</span><span class="token1">]</span> <span class="token">=</span> $cat_ids<span class="token1">;</span> $flag <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>shopDistributorModel<span class="token">-</span><span class="token">></span><span class="token3">addShopDistributor</span><span class="token1">(</span>$supplier_row<span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> ``` ``` 视图:shop/views/default/Seller/Supplier/SupplierCtl/apply.php 3.删除 视图:shop/views/default/Seller/Supplier/SupplierCtl/index.php 方法:edit\_statu() ``` <pre class="calibre14">``` <span class="token2">if</span><span class="token1">(</span><span class="token3">request_string</span><span class="token1">(</span><span class="token4">'act'</span><span class="token1">)</span> <span class="token">&&</span> <span class="token3">request_string</span><span class="token1">(</span><span class="token4">'act'</span><span class="token1">)</span> <span class="token">==</span><span class="token4">"again"</span><span class="token1">)</span> <span class="token1">{</span> <span class="token5">//再次申请</span> $edit_row<span class="token1">[</span><span class="token4">'distributor_enable'</span><span class="token1">]</span> <span class="token">=</span> <span class="token6">0</span><span class="token1">;</span> $flag<span class="token">=</span>$this<span class="token">-</span><span class="token">></span>shopDistributorModel<span class="token">-</span><span class="token">></span><span class="token3">editShopDistributor</span><span class="token1">(</span>$shop_distributor_id<span class="token1">,</span>$edit_row<span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span><span class="token3">elseif</span><span class="token1">(</span><span class="token3">request_string</span><span class="token1">(</span><span class="token4">'act'</span><span class="token1">)</span> <span class="token">&&</span> <span class="token3">request_string</span><span class="token1">(</span><span class="token4">'act'</span><span class="token1">)</span> <span class="token">==</span><span class="token4">"del"</span><span class="token1">)</span> <span class="token1">{</span> <span class="token5">//删除</span> $supplier_base <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>shopDistributorModel<span class="token">-</span><span class="token">></span><span class="token3">getOne</span><span class="token1">(</span>$shop_distributor_id<span class="token1">)</span><span class="token1">;</span> $flag<span class="token">=</span>$this<span class="token">-</span><span class="token">></span>shopDistributorModel<span class="token">-</span><span class="token">></span><span class="token3">removeShopDistributor</span><span class="token1">(</span>$shop_distributor_id<span class="token1">)</span><span class="token1">;</span> <span class="token5">//删除分销商品</span> $goodsCommonModel <span class="token">=</span> <span class="token2">new</span> <span class="token3">Goods_CommonModel</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> $commons <span class="token">=</span>$goodsCommonModel <span class="token">-</span><span class="token">></span> <span class="token3">getByWhere</span><span class="token1">(</span><span class="token3">array</span><span class="token1">(</span><span class="token4">'shop_id'</span><span class="token">=</span><span class="token">></span>Perm<span class="token1">:</span><span class="token1">:</span>$shopId<span class="token1">,</span><span class="token4">'supply_shop_id'</span><span class="token">=</span><span class="token">></span>$supplier_base<span class="token1">[</span><span class="token4">'shop_id'</span><span class="token1">]</span><span class="token1">)</span><span class="token1">)</span><span class="token1">;</span> <span class="token2">if</span><span class="token1">(</span><span class="token">!</span><span class="token3">empty</span><span class="token1">(</span>$commons<span class="token1">)</span><span class="token1">)</span> <span class="token1">{</span> foreach <span class="token1">(</span>$commons as $key <span class="token">=</span><span class="token">></span> $value<span class="token1">)</span> <span class="token1">{</span> $goodsCommonModel<span class="token">-</span><span class="token">></span><span class="token3">removeCommon</span><span class="token1">(</span>$value<span class="token1">[</span><span class="token4">'common_id'</span><span class="token1">]</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> <span class="token1">}</span> <span class="token1">}</span> ``` ``` **我的分销商(供应商用户)** 文件路径:shop/controllers/Seller/Supplier/DistributorCtl.php 分销商审核状态: ``` <pre class="calibre14">``` <span class="token5">//审核状态</span> <span class="token2">if</span><span class="token1">(</span><span class="token3">request_int</span><span class="token1">(</span><span class="token4">'state'</span><span class="token1">)</span><span class="token">==</span><span class="token6">1</span><span class="token1">)</span> <span class="token1">{</span> $cond_row<span class="token1">[</span><span class="token4">'distributor_enable'</span><span class="token1">]</span> <span class="token">=</span><span class="token6">1</span><span class="token1">;</span> <span class="token5">//审核通过</span> <span class="token1">}</span><span class="token3">elseif</span><span class="token1">(</span><span class="token3">request_int</span><span class="token1">(</span><span class="token4">'state'</span><span class="token1">)</span><span class="token">==</span><span class="token6">2</span><span class="token1">)</span> <span class="token1">{</span> $cond_row<span class="token1">[</span><span class="token4">'distributor_enable'</span><span class="token1">]</span> <span class="token">=</span><span class="token6">0</span><span class="token1">;</span> <span class="token5">//未审核</span> <span class="token1">}</span><span class="token3">elseif</span><span class="token1">(</span><span class="token3">request_int</span><span class="token1">(</span><span class="token4">'state'</span><span class="token1">)</span><span class="token">==</span><span class="token6">3</span><span class="token1">)</span> <span class="token1">{</span> $cond_row<span class="token1">[</span><span class="token4">'distributor_enable'</span><span class="token1">]</span> <span class="token">=</span><span class="token">-</span><span class="token6">1</span><span class="token1">;</span> <span class="token5">//审核未通过</span> <span class="token1">}</span> ``` ``` 一、我的分销商 1.分销商列表 视图:shop/views/default/Seller/Supplier/DistributorCtl/index.php 方法:index() `$data = $this->shopDistributorModel->listByWhere($cond_row, $order_row, $page, $rows);` 二、操作 1.分销业绩 视图:shop/views/default/Seller/Supplier/DistributorCtl/distributor\_salenum.php 方法:distributor\_salenum() `$data = $Goods_CommonModel->listByWhere($cond_row, $order_row, $page, $rows);` 2.查看分销商详情 方法:index() 参数:distributor\_id 视图:shop/views/default/Seller/Supplier/DistributorCtl/apply.php ``` <pre class="calibre14">``` <span class="token2">if</span><span class="token1">(</span><span class="token3">request_int</span><span class="token1">(</span><span class="token4">'distributor_id'</span><span class="token1">)</span><span class="token1">)</span> <span class="token1">{</span> $distributor_info <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>shopDistributorModel<span class="token">-</span><span class="token">></span><span class="token3">getOne</span><span class="token1">(</span><span class="token3">request_int</span><span class="token1">(</span><span class="token4">'distributor_id'</span><span class="token1">)</span><span class="token1">)</span><span class="token1">;</span> $distributor_shop_info <span class="token">=</span> $shopBaseModel<span class="token">-</span><span class="token">></span><span class="token3">getOneByWhere</span><span class="token1">(</span><span class="token3">array</span><span class="token1">(</span><span class="token4">'shop_id'</span><span class="token">=</span><span class="token">></span>$distributor_info<span class="token1">[</span><span class="token4">'distributor_id'</span><span class="token1">]</span><span class="token1">)</span><span class="token1">)</span><span class="token1">;</span> $shopGoodCatModel <span class="token">=</span> <span class="token2">new</span> <span class="token3">Shop_GoodCatModel</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> $cat_row<span class="token1">[</span><span class="token4">'shop_id'</span><span class="token1">]</span> <span class="token">=</span> Perm<span class="token1">:</span><span class="token1">:</span>$shopId<span class="token1">;</span> $shop_cat <span class="token">=</span> $shopGoodCatModel<span class="token">-</span><span class="token">></span><span class="token3">getGoodCatList</span><span class="token1">(</span>$cat_row<span class="token1">,</span> <span class="token3">array</span><span class="token1">(</span><span class="token1">)</span><span class="token1">)</span><span class="token1">;</span> $distributor_cat <span class="token">=</span> <span class="token3">explode</span><span class="token1">(</span><span class="token4">','</span><span class="token1">,</span>$distributor_info<span class="token1">[</span><span class="token4">'distributor_cat_ids'</span><span class="token1">]</span><span class="token1">)</span><span class="token1">;</span> $distributor_new_cat <span class="token">=</span> <span class="token3">explode</span><span class="token1">(</span><span class="token4">','</span><span class="token1">,</span>$distributor_info<span class="token1">[</span><span class="token4">'distributor_new_cat_ids'</span><span class="token1">]</span><span class="token1">)</span><span class="token1">;</span> $distributor_cat_name <span class="token">=</span> <span class="token3">array</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> $distributor_new_cat_name <span class="token">=</span> <span class="token3">array</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> <span class="token2">if</span><span class="token1">(</span>$distributor_cat<span class="token1">)</span> <span class="token1">{</span> <span class="token3">foreach</span><span class="token1">(</span>$distributor_cat as $k<span class="token">=</span><span class="token">></span>$v<span class="token1">)</span> <span class="token1">{</span> $temp <span class="token">=</span> $shopGoodCatModel<span class="token">-</span><span class="token">></span><span class="token3">getOneByWhere</span><span class="token1">(</span><span class="token3">array</span><span class="token1">(</span><span class="token4">'shop_goods_cat_id'</span><span class="token">=</span><span class="token">></span>$v<span class="token1">)</span><span class="token1">)</span><span class="token1">;</span> <span class="token2">if</span><span class="token1">(</span>$temp<span class="token1">)</span> <span class="token1">{</span> $distributor_cat_name<span class="token1">[</span><span class="token1">]</span> <span class="token">=</span> $temp<span class="token1">[</span><span class="token4">'shop_goods_cat_name'</span><span class="token1">]</span><span class="token1">;</span> <span class="token1">}</span> <span class="token1">}</span> <span class="token1">}</span> $distributor_cat_name <span class="token">=</span> <span class="token3">implode</span><span class="token1">(</span><span class="token4">','</span><span class="token1">,</span>$distributor_cat_name<span class="token1">)</span><span class="token1">;</span> <span class="token2">if</span><span class="token1">(</span>$distributor_new_cat<span class="token1">)</span> <span class="token1">{</span> <span class="token3">foreach</span><span class="token1">(</span>$distributor_new_cat as $k<span class="token">=</span><span class="token">></span>$v<span class="token1">)</span> <span class="token1">{</span> $temp <span class="token">=</span> $shopGoodCatModel<span class="token">-</span><span class="token">></span><span class="token3">getOneByWhere</span><span class="token1">(</span><span class="token3">array</span><span class="token1">(</span><span class="token4">'shop_goods_cat_id'</span><span class="token">=</span><span class="token">></span>$v<span class="token1">)</span><span class="token1">)</span><span class="token1">;</span> <span class="token2">if</span><span class="token1">(</span>$temp<span class="token1">)</span> <span class="token1">{</span> $distributor_new_cat_name<span class="token1">[</span><span class="token1">]</span> <span class="token">=</span> $temp<span class="token1">[</span><span class="token4">'shop_goods_cat_name'</span><span class="token1">]</span><span class="token1">;</span> <span class="token1">}</span> <span class="token1">}</span> <span class="token1">}</span> $distributor_new_cat_name <span class="token">=</span> <span class="token3">implode</span><span class="token1">(</span><span class="token4">','</span><span class="token1">,</span>$distributor_new_cat_name<span class="token1">)</span><span class="token1">;</span> $this<span class="token">-</span><span class="token">></span>view<span class="token">-</span><span class="token">></span><span class="token3">setMet</span><span class="token1">(</span><span class="token4">'apply'</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> ``` ``` 3.设置等级 方法:addGrade()、editGrade() 视图:shop/views/default/Seller/Supplier/DistributorCtl/addGrade.php 确认提交:$('.bbc\_seller\_submit\_btns').click(function (){}) ``` <pre class="calibre14">``` <span class="token5">//新增、编辑分销商等级</span> <span class="token2">if</span><span class="token1">(</span><span class="token3">request_string</span><span class="token1">(</span><span class="token4">'act'</span><span class="token1">)</span> <span class="token">&&</span> <span class="token3">request_string</span><span class="token1">(</span><span class="token4">'act'</span><span class="token1">)</span> <span class="token">==</span> <span class="token4">"edit"</span><span class="token1">)</span> <span class="token1">{</span> $flag <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>shopDistributorLevelModel<span class="token">-</span><span class="token">></span><span class="token3">editShopDistributorLevel</span><span class="token1">(</span>$distributor_level_id<span class="token1">,</span>$cond_row<span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span><span class="token2">else</span><span class="token1">{</span> $flag <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>shopDistributorLevelModel<span class="token">-</span><span class="token">></span><span class="token3">addShopDistributorLevel</span><span class="token1">(</span>$cond_row<span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> ``` ``` 4.删除、审核分销商 方法:edit\_statu() ``` <pre class="calibre14">``` <span class="token2">if</span><span class="token1">(</span><span class="token3">request_string</span><span class="token1">(</span><span class="token4">'act'</span><span class="token1">)</span> <span class="token">&&</span> <span class="token3">request_string</span><span class="token1">(</span><span class="token4">'act'</span><span class="token1">)</span> <span class="token">==</span> <span class="token4">'agree'</span><span class="token1">)</span> <span class="token1">{</span> $field_row<span class="token1">[</span><span class="token4">'distributor_enable'</span><span class="token1">]</span> <span class="token">=</span> <span class="token6">1</span><span class="token1">;</span> $field_row<span class="token1">[</span><span class="token4">'distributor_cat_ids'</span><span class="token1">]</span> <span class="token">=</span> $shop_dist_base<span class="token1">[</span><span class="token4">'distributor_new_cat_ids'</span><span class="token1">]</span><span class="token1">;</span> $field_row<span class="token1">[</span><span class="token4">'distributor_new_cat_ids'</span><span class="token1">]</span> <span class="token">=</span> <span class="token4">''</span><span class="token1">;</span> $flag<span class="token">=</span>$this<span class="token">-</span><span class="token">></span>shopDistributorModel<span class="token">-</span><span class="token">></span><span class="token3">editShopDistributor</span><span class="token1">(</span>$shop_distributor_id<span class="token1">,</span>$field_row<span class="token1">)</span><span class="token1">;</span> <span class="token5">//发送消息</span> $MessageModel<span class="token">-</span><span class="token">></span><span class="token3">sendMessage</span><span class="token1">(</span><span class="token4">'dist apply statu'</span><span class="token1">,</span>$dist_shop_base<span class="token1">[</span><span class="token4">'user_id'</span><span class="token1">]</span><span class="token1">,</span> $dist_shop_base<span class="token1">[</span><span class="token4">'user_name'</span><span class="token1">]</span><span class="token1">,</span> $order_id <span class="token">=</span> NULL<span class="token1">,</span> $shop_name<span class="token">=</span><span class="token2">null</span><span class="token1">,</span> <span class="token6">1</span><span class="token1">,</span> <span class="token6">1</span><span class="token1">,</span> $end_time <span class="token">=</span> Null<span class="token1">,</span>$common_id<span class="token">=</span><span class="token2">null</span><span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> <span class="token3">elseif</span><span class="token1">(</span><span class="token3">request_string</span><span class="token1">(</span><span class="token4">'act'</span><span class="token1">)</span> <span class="token">&&</span> <span class="token3">request_string</span><span class="token1">(</span><span class="token4">'act'</span><span class="token1">)</span> <span class="token">==</span> <span class="token4">'del'</span><span class="token1">)</span> <span class="token1">{</span> $flag<span class="token">=</span>$this<span class="token">-</span><span class="token">></span>shopDistributorModel<span class="token">-</span><span class="token">></span><span class="token3">removeShopDistributor</span><span class="token1">(</span>$shop_distributor_id<span class="token1">)</span><span class="token1">;</span> <span class="token5">//删除分销商品</span> $goodsCommonModel <span class="token">=</span> <span class="token2">new</span> <span class="token3">Goods_CommonModel</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> $commons <span class="token">=</span>$goodsCommonModel <span class="token">-</span><span class="token">></span> <span class="token3">getByWhere</span><span class="token1">(</span><span class="token3">array</span><span class="token1">(</span><span class="token4">'shop_id'</span><span class="token">=</span><span class="token">></span>$dist_shop_base<span class="token1">[</span><span class="token4">'shop_id'</span><span class="token1">]</span><span class="token1">,</span><span class="token4">'supply_shop_id'</span><span class="token">=</span><span class="token">></span>Perm<span class="token1">:</span><span class="token1">:</span>$shopId<span class="token1">)</span><span class="token1">)</span><span class="token1">;</span> <span class="token2">if</span><span class="token1">(</span><span class="token">!</span><span class="token3">empty</span><span class="token1">(</span>$commons<span class="token1">)</span><span class="token1">)</span> <span class="token1">{</span> foreach <span class="token1">(</span>$commons as $key <span class="token">=</span><span class="token">></span> $value<span class="token1">)</span> <span class="token1">{</span> $goodsCommonModel<span class="token">-</span><span class="token">></span><span class="token3">removeCommon</span><span class="token1">(</span>$value<span class="token1">[</span><span class="token4">'common_id'</span><span class="token1">]</span><span class="token1">)</span><span class="token1">;</span> <span class="token5">//发送消息</span> $des <span class="token">=</span> <span class="token4">'供货商删除你的分销权限'</span><span class="token1">;</span> $MessageModel<span class="token">-</span><span class="token">></span><span class="token3">sendMessage</span><span class="token1">(</span><span class="token4">'del goods'</span><span class="token1">,</span>$dist_shop_base<span class="token1">[</span><span class="token4">'user_id'</span><span class="token1">]</span><span class="token1">,</span> $dist_shop_base<span class="token1">[</span><span class="token4">'user_name'</span><span class="token1">]</span><span class="token1">,</span> $order_id <span class="token">=</span> NULL<span class="token1">,</span> $shop_name<span class="token">=</span><span class="token2">null</span><span class="token1">,</span> <span class="token6">1</span><span class="token1">,</span> <span class="token6">1</span><span class="token1">,</span> $end_time <span class="token">=</span> Null<span class="token1">,</span>$value<span class="token1">[</span><span class="token4">'common_id'</span><span class="token1">]</span><span class="token1">,</span>$goods_id<span class="token">=</span><span class="token2">null</span><span class="token1">,</span>$des<span class="token1">)</span><span class="token1">;</span> <span class="token1">}</span> <span class="token1">}</span> <span class="token1">}</span> ``` ``` 5.分销商审核不通过 视图:shop/views/default/Seller/Supplier/DistributorCtl/index.php ``` <pre class="calibre14">``` <span class="token"><</span>div id<span class="token">=</span><span class="token4">"apply-disagree"</span> class<span class="token">=</span><span class="token4">"eject_con"</span> <span class="token">></span> <span class="token"><</span>input type<span class="token">=</span><span class="token4">"hidden"</span> name<span class="token">=</span><span class="token4">"shop_grade_id"</span> id<span class="token">=</span><span class="token4">"shop_grade_id"</span> value<span class="token">=</span><span class="token4">""</span> <span class="token">/</span><span class="token">></span> <span class="token"><</span>textarea id<span class="token">=</span><span class="token4">"reason"</span><span class="token">></span><span class="token"><</span><span class="token">/</span>textarea<span class="token">></span> <span class="token"><</span>div class<span class="token">=</span><span class="token4">"eject_con mb10"</span><span class="token">></span> <span class="token"><</span>div class<span class="token">=</span><span class="token4">"bottom"</span><span class="token">></span><span class="token"><</span>a id<span class="token">=</span><span class="token4">"btn_apply_submit"</span> class<span class="token">=</span><span class="token4">"button bbc_seller_submit_btns"</span> href<span class="token">=</span><span class="token4">"javascript:void(0);"</span><span class="token">></span><span class="token"><</span><span class="token">?</span><span class="token">=</span><span class="token3">__</span><span class="token1">(</span><span class="token4">'提交'</span><span class="token1">)</span><span class="token">?</span><span class="token">></span><span class="token"><</span><span class="token">/</span>a<span class="token">></span><span class="token"><</span><span class="token">/</span>div<span class="token">></span> <span class="token"><</span><span class="token">/</span>div<span class="token">></span> <span class="token"><</span><span class="token">/</span>div<span class="token">></span> $<span class="token1">(</span><span class="token4">"#btn_apply_submit"</span><span class="token1">)</span><span class="token1">.</span><span class="token3">click</span><span class="token1">(</span><span class="token2">function</span> <span class="token1">(</span><span class="token1">)</span><span class="token1">{</span> var shop_distributor_id <span class="token">=</span> $<span class="token1">(</span><span class="token4">"#shop_distributor_id"</span><span class="token1">)</span><span class="token1">.</span><span class="token3">val</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> var reason <span class="token">=</span> $<span class="token1">(</span><span class="token4">"#reason"</span><span class="token1">)</span><span class="token1">.</span><span class="token3">val</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span> <span class="token2">if</span><span class="token1">(</span>reason<span class="token1">.</span>length <span class="token">==</span> <span class="token6">0</span><span class="token1">)</span><span class="token1">{</span> Public<span class="token1">.</span>tips<span class="token1">.</span><span class="token3">error</span><span class="token1">(</span><span class="token4">'<?=__('</span>请填写原因<span class="token">!</span><span class="token4">')?>'</span><span class="token1">)</span><span class="token1">;</span> <span class="token2">return</span> <span class="token6">false</span><span class="token1">;</span> <span class="token1">}</span> var ajax_url <span class="token">=</span> <span class="token4">'./index.php?ctl=Seller_Supplier_Distributor&met=apply_disagree&typ=json'</span><span class="token1">;</span> $<span class="token1">.</span><span class="token3">ajax</span><span class="token1">(</span><span class="token1">{</span> url<span class="token1">:</span>ajax_url<span class="token1">,</span> data<span class="token1">:</span><span class="token1">{</span>shop_distributor_id<span class="token1">:</span>shop_distributor_id<span class="token1">,</span>reason<span class="token1">:</span>reason<span class="token1">}</span><span class="token1">,</span> success<span class="token1">:</span><span class="token2">function</span><span class="token1">(</span>a<span class="token1">)</span><span class="token1">{</span> <span class="token1">.</span> <span class="token1">.</span> <span class="token1">.</span> <span class="token1">}</span> <span class="token1">}</span><span class="token1">)</span> <span class="token1">}</span><span class="token1">)</span> ``` ``` 方法:apply\_disagree() ``` <pre class="calibre15">``` <span class="token5">//不通过分销商申请,添加原因</span> $flag <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>shopDistributorModel<span class="token">-</span><span class="token">></span><span class="token3">editShopDistributor</span><span class="token1">(</span>$shop_distributor_id<span class="token1">,</span>$field_row<span class="token1">)</span><span class="token1">;</span> ``` ```