# 投诉管理
一、买家投诉
文件路径:shop/controllers/Buyer/Service/ComplainCtl.php
视图:shop/views/default/Buyer/Service/ComplainCtl/add.php
投诉表单提交:`$('#form').validator({})`
方法:addComplain()
```
<pre class="calibre14">```
$add_flag <span class="token">=</span> $complain_id <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>complainBaseModel<span class="token">-</span><span class="token">></span><span class="token3">addBase</span><span class="token1">(</span>$field<span class="token1">,</span> <span class="token6">true</span><span class="token1">)</span><span class="token1">;</span>
<span class="token3">check_rs</span><span class="token1">(</span>$add_flag<span class="token1">,</span> $rs_row<span class="token1">)</span><span class="token1">;</span>
$field2<span class="token1">[</span><span class="token4">'complain_id'</span><span class="token1">]</span> <span class="token">=</span> $complain_id<span class="token1">;</span>
$field2<span class="token1">[</span><span class="token4">'goods_id'</span><span class="token1">]</span> <span class="token">=</span> $goods<span class="token1">[</span><span class="token4">'goods_id'</span><span class="token1">]</span><span class="token1">;</span>
$field2<span class="token1">[</span><span class="token4">'goods_name'</span><span class="token1">]</span> <span class="token">=</span> $goods<span class="token1">[</span><span class="token4">'goods_name'</span><span class="token1">]</span><span class="token1">;</span>
$field2<span class="token1">[</span><span class="token4">'goods_price'</span><span class="token1">]</span> <span class="token">=</span> $goods<span class="token1">[</span><span class="token4">'goods_price'</span><span class="token1">]</span><span class="token1">;</span>
$field2<span class="token1">[</span><span class="token4">'goods_num'</span><span class="token1">]</span> <span class="token">=</span> $goods<span class="token1">[</span><span class="token4">'order_goods_num'</span><span class="token1">]</span><span class="token1">;</span>
$field2<span class="token1">[</span><span class="token4">'goods_image'</span><span class="token1">]</span> <span class="token">=</span> $goods<span class="token1">[</span><span class="token4">'goods_image'</span><span class="token1">]</span><span class="token1">;</span>
$field2<span class="token1">[</span><span class="token4">'complain_message'</span><span class="token1">]</span> <span class="token">=</span> $complain_content<span class="token1">;</span>
$field2<span class="token1">[</span><span class="token4">'order_goods_id'</span><span class="token1">]</span> <span class="token">=</span> $goods_id<span class="token1">;</span>
$field2<span class="token1">[</span><span class="token4">'order_goods_type'</span><span class="token1">]</span> <span class="token">=</span> <span class="token6">1</span><span class="token1">;</span>
$field2<span class="token1">[</span><span class="token4">'order_id'</span><span class="token1">]</span> <span class="token">=</span> $goods<span class="token1">[</span><span class="token4">'order_id'</span><span class="token1">]</span><span class="token1">;</span>
$add_flag <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>complainGoodsModel<span class="token">-</span><span class="token">></span><span class="token3">addGoods</span><span class="token1">(</span>$field2<span class="token1">)</span><span class="token1">;</span>
```
```
二、平台审核
文件路径:shop/controllers/Api/Trade/ComplainCtl.php
视图:shop\_admin/view/default/Trade/ComplainCtl/complain.php
JS:shop\_admin/static/default/js/controllers/trade/complain/complain\_list.js
三、卖家申诉
文件路径:shop/controllers/Seller/Service/ComplainCtl.php
视图:shop/views/default/Seller/Service/ComplainCtl/detail.php
`<input id="handle_submit" type="button" class="button button_red bbc_seller_submit_btns" value="<?=__('确认提交')?>">`
申诉提交表单验证:
```
<pre class="calibre14">```
$<span class="token1">(</span><span class="token4">'#form'</span><span class="token1">)</span><span class="token1">.</span><span class="token3">validator</span><span class="token1">(</span><span class="token1">{</span>
ignore<span class="token1">:</span> <span class="token4">':hidden'</span><span class="token1">,</span>
theme<span class="token1">:</span> <span class="token4">'yellow_right'</span><span class="token1">,</span>
timely<span class="token1">:</span> <span class="token6">1</span><span class="token1">,</span>
stopOnError<span class="token1">:</span> <span class="token6">false</span><span class="token1">,</span>
fields<span class="token1">:</span> field<span class="token1">,</span>
valid<span class="token1">:</span> <span class="token2">function</span> <span class="token1">(</span>form<span class="token1">)</span>
<span class="token1">{</span>
<span class="token5">//表单验证通过,提交表单</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><span class="token4">"#form"</span><span class="token1">)</span><span class="token1">.</span><span class="token3">serialize</span><span class="token1">(</span><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="token2">if</span> <span class="token1">(</span>a<span class="token1">.</span>status <span class="token">==</span> <span class="token6">200</span><span class="token1">)</span>
<span class="token1">{</span>
location<span class="token1">.</span>href <span class="token">=</span> <span class="token4">"./index.php?ctl=Seller_Service_Complain&met=index&act=detail&id=<?=$data['id']?>"</span><span class="token1">;</span>
<span class="token1">}</span>
<span class="token2">else</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="token4">')?>'</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><span class="token1">)</span><span class="token1">.</span><span class="token3">on</span><span class="token1">(</span><span class="token4">"click"</span><span class="token1">,</span> <span class="token4">"#handle_submit"</span><span class="token1">,</span> <span class="token2">function</span> <span class="token1">(</span>e<span class="token1">)</span>
<span class="token1">{</span>
$<span class="token1">(</span>e<span class="token1">.</span>delegateTarget<span class="token1">)</span><span class="token1">.</span><span class="token3">trigger</span><span class="token1">(</span><span class="token4">"validate"</span><span class="token1">)</span><span class="token1">;</span>
<span class="token1">}</span><span class="token1">)</span><span class="token1">;</span>
```
```
三、买卖双方对话
- 卖家:
文件路径:shop/controllers/Seller/Service/ComplainCtl.php
视图:shop/views/default/Seller/Service/ComplainCtl/detail.php
方法:publishComplainTalk()
```
<pre class="calibre14">```
$<span class="token1">(</span><span class="token4">"#btn_publish"</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>
<span class="token2">if</span> <span class="token1">(</span>$<span class="token1">(</span><span class="token4">"#complain_talk"</span><span class="token1">)</span><span class="token1">.</span><span class="token3">val</span><span class="token1">(</span><span class="token1">)</span> <span class="token">==</span> <span class="token4">''</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="token1">)</span><span class="token1">;</span>
<span class="token1">}</span>
<span class="token2">else</span>
<span class="token1">{</span>
<span class="token3">publish_complain_talk</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="token5">//发布对话</span>
<span class="token2">function</span> <span class="token3">publish_complain_talk</span><span class="token1">(</span><span class="token1">)</span>
<span class="token1">{</span>
$<span class="token1">.</span><span class="token3">ajax</span><span class="token1">(</span><span class="token1">{</span>
type<span class="token1">:</span> <span class="token4">'POST'</span><span class="token1">,</span>
url<span class="token1">:</span> SITE_URL <span class="token">+</span> <span class="token4">'?ctl=Buyer_Service_Complain&met=publishComplainTalk&typ=json'</span><span class="token1">,</span>
cache<span class="token1">:</span> <span class="token6">false</span><span class="token1">,</span>
data<span class="token1">:</span> <span class="token4">"complain_id="</span> <span class="token">+</span> complain_id <span class="token">+</span> <span class="token4">"&complain_talk="</span> <span class="token">+</span> <span class="token3">encodeURIComponent</span><span class="token1">(</span>$<span class="token1">(</span><span class="token4">"#complain_talk"</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="token1">,</span>
dataType<span class="token1">:</span> <span class="token4">'json'</span><span class="token1">,</span>
error<span class="token1">:</span> <span class="token2">function</span> <span class="token1">(</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="token1">)</span><span class="token1">;</span>
<span class="token1">}</span><span class="token1">,</span>
success<span class="token1">:</span> <span class="token2">function</span> <span class="token1">(</span>d<span class="token1">)</span>
<span class="token1">{</span>
<span class="token2">if</span> <span class="token1">(</span>d<span class="token1">.</span>msg <span class="token">==</span> <span class="token4">'success'</span><span class="token1">)</span>
<span class="token1">{</span>
$<span class="token1">(</span><span class="token4">"#complain_talk"</span><span class="token1">)</span><span class="token1">.</span><span class="token3">val</span><span class="token1">(</span><span class="token4">''</span><span class="token1">)</span><span class="token1">;</span>
Public<span class="token1">.</span>tips<span class="token1">.</span><span class="token3">success</span><span class="token1">(</span><span class="token4">"<?=__('对话发送成功')?>"</span><span class="token1">)</span><span class="token1">;</span>
<span class="token3">get_complain_talk</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span>
<span class="token1">}</span>
<span class="token2">else</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="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>
```
```
```
<pre class="calibre14">```
$Complain_TalkModel <span class="token">=</span> <span class="token2">new</span> <span class="token3">Complain_TalkModel</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span>
$flag <span class="token">=</span> $Complain_TalkModel<span class="token">-</span><span class="token">></span><span class="token3">addTalk</span><span class="token1">(</span>$filed<span class="token1">)</span><span class="token1">;</span>
```
```
- 买家:
文件路径:shop/controllers/Buyer/Service/ComplainCtl.php
视图:shop/views/default/Buyer/Service/ComplainCtl/detail.php
```
<pre class="calibre14">```
$<span class="token1">(</span><span class="token4">"#btn_publish"</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>
<span class="token2">if</span> <span class="token1">(</span>$<span class="token1">(</span><span class="token4">"#complain_talk"</span><span class="token1">)</span><span class="token1">.</span><span class="token3">val</span><span class="token1">(</span><span class="token1">)</span> <span class="token">==</span> <span class="token4">''</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="token1">)</span><span class="token1">;</span>
<span class="token1">}</span>
<span class="token2">else</span>
<span class="token1">{</span>
<span class="token3">publish_complain_talk</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="token5">//发布对话</span>
<span class="token2">function</span> <span class="token3">publish_complain_talk</span><span class="token1">(</span><span class="token1">)</span>
<span class="token1">{</span>
$<span class="token1">.</span><span class="token3">ajax</span><span class="token1">(</span><span class="token1">{</span>
type<span class="token1">:</span> <span class="token4">'POST'</span><span class="token1">,</span>
url<span class="token1">:</span> SITE_URL <span class="token">+</span> <span class="token4">'?ctl=Buyer_Service_Complain&met=publishComplainTalk&typ=json'</span><span class="token1">,</span>
cache<span class="token1">:</span> <span class="token6">false</span><span class="token1">,</span>
data<span class="token1">:</span> <span class="token4">"complain_id="</span> <span class="token">+</span> complain_id <span class="token">+</span> <span class="token4">"&complain_talk="</span> <span class="token">+</span> <span class="token3">encodeURIComponent</span><span class="token1">(</span>$<span class="token1">(</span><span class="token4">"#complain_talk"</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="token1">,</span>
dataType<span class="token1">:</span> <span class="token4">'json'</span><span class="token1">,</span>
error<span class="token1">:</span> <span class="token2">function</span> <span class="token1">(</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="token1">)</span><span class="token1">;</span>
<span class="token1">}</span><span class="token1">,</span>
success<span class="token1">:</span> <span class="token2">function</span> <span class="token1">(</span>d<span class="token1">)</span>
<span class="token1">{</span>
<span class="token2">if</span> <span class="token1">(</span>d<span class="token1">.</span>msg <span class="token">==</span> <span class="token4">'success'</span><span class="token1">)</span>
<span class="token1">{</span>
$<span class="token1">(</span><span class="token4">"#complain_talk"</span><span class="token1">)</span><span class="token1">.</span><span class="token3">val</span><span class="token1">(</span><span class="token4">''</span><span class="token1">)</span><span class="token1">;</span>
Public<span class="token1">.</span>tips<span class="token1">.</span><span class="token3">success</span><span class="token1">(</span><span class="token4">"<?=__('对话发送成功')?>"</span><span class="token1">)</span><span class="token1">;</span>
<span class="token3">get_complain_talk</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span>
<span class="token1">}</span>
<span class="token2">else</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="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>
```
```
方法:publishComplainTalk()
```
<pre class="calibre14">```
$Complain_TalkModel <span class="token">=</span> <span class="token2">new</span> <span class="token3">Complain_TalkModel</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span>
$flag <span class="token">=</span> $Complain_TalkModel<span class="token">-</span><span class="token">></span><span class="token3">addTalk</span><span class="token1">(</span>$filed<span class="token1">)</span><span class="token1">;</span>
```
```
四、平台仲裁
文件路径:shop/controllers/Api/Trade/ComplainCtl.php
视图:shop\_admin/view/default/Trade/ComplainCtl/getComplainInfo.php
JS:shop\_admin/static/default/js/controllers/trade/complain/progress.js
关闭投诉、处理意见:
```
<pre class="calibre14">```
$<span class="token1">(</span><span class="token4">'#close_form'</span><span class="token1">)</span><span class="token1">.</span><span class="token3">validator</span><span class="token1">(</span><span class="token1">{</span>
ignore<span class="token1">:</span> <span class="token4">':hidden'</span><span class="token1">,</span>
theme<span class="token1">:</span> <span class="token4">'yellow_bottom'</span><span class="token1">,</span>
timely<span class="token1">:</span> <span class="token6">1</span><span class="token1">,</span>
stopOnError<span class="token1">:</span> <span class="token6">true</span><span class="token1">,</span>
fields<span class="token1">:</span> <span class="token1">{</span>
<span class="token4">'final_handle_message'</span><span class="token1">:</span> <span class="token4">'required;'</span>
<span class="token1">}</span><span class="token1">,</span>
valid<span class="token1">:</span> <span class="token2">function</span> <span class="token1">(</span>form<span class="token1">)</span>
<span class="token1">{</span>
parent<span class="token1">.</span>$<span class="token1">.</span>dialog<span class="token1">.</span><span class="token3">confirm</span><span class="token1">(</span><span class="token4">'确认关闭此投诉?'</span><span class="token1">,</span> <span class="token2">function</span> <span class="token1">(</span><span class="token1">)</span>
<span class="token1">{</span>
Public<span class="token1">.</span><span class="token3">ajaxPost</span><span class="token1">(</span>SITE_URL <span class="token">+</span> <span class="token4">'?ctl=Trade_Complain&met=handleComplain&typ=json'</span><span class="token1">,</span> $<span class="token1">(</span><span class="token4">"#close_form"</span><span class="token1">)</span><span class="token1">.</span><span class="token3">serialize</span><span class="token1">(</span><span class="token1">)</span><span class="token1">,</span> <span class="token2">function</span> <span class="token1">(</span>data<span class="token1">)</span>
<span class="token1">{</span>
<span class="token2">if</span> <span class="token1">(</span>data<span class="token1">.</span>status <span class="token">==</span> <span class="token6">200</span><span class="token1">)</span>
<span class="token1">{</span>
parent<span class="token1">.</span>Public<span class="token1">.</span><span class="token3">tips</span><span class="token1">(</span><span class="token1">{</span>content<span class="token1">:</span> <span class="token4">'操作成功!'</span><span class="token1">}</span><span class="token1">)</span><span class="token1">;</span>
window<span class="token1">.</span>location<span class="token1">.</span>href <span class="token">=</span> SITE_URL <span class="token">+</span> <span class="token4">"?ctl=Trade_Complain&met=complain&state=5"</span><span class="token1">;</span>
<span class="token1">}</span>
<span class="token2">else</span>
<span class="token1">{</span>
parent<span class="token1">.</span>Public<span class="token1">.</span><span class="token3">tips</span><span class="token1">(</span><span class="token1">{</span>type<span class="token1">:</span> <span class="token6">1</span><span class="token1">,</span> content<span class="token1">:</span> data<span class="token1">.</span>msg <span class="token">||</span> <span class="token4">'操作无法成功,请稍后重试!'</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>
<span class="token2">function</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><span class="token1">)</span><span class="token1">.</span><span class="token3">on</span><span class="token1">(</span><span class="token4">"click"</span><span class="token1">,</span> <span class="token4">"a#btn_handle_submit"</span><span class="token1">,</span> <span class="token2">function</span> <span class="token1">(</span>e<span class="token1">)</span>
<span class="token1">{</span>
$<span class="token1">(</span>e<span class="token1">.</span>delegateTarget<span class="token1">)</span><span class="token1">.</span><span class="token3">trigger</span><span class="token1">(</span><span class="token4">"validate"</span><span class="token1">)</span><span class="token1">;</span>
<span class="token1">}</span><span class="token1">)</span><span class="token1">;</span>
```
```
五、店铺投诉管理
文件路径:shop/controllers/Seller/Service/ComplainCtl.php
- 投诉状态:1-新投诉、2-待申诉、3-对话中、4-待仲裁、5-已关闭
```
<pre class="calibre14">```
const COMPLAIN_FRESH <span class="token">=</span> <span class="token6">1</span><span class="token1">;</span>
const COMPLAIN_APPEAL <span class="token">=</span> <span class="token6">2</span><span class="token1">;</span>
const COMPLAIN_TALK <span class="token">=</span> <span class="token6">3</span><span class="token1">;</span>
const COMPLAIN_HANDLE <span class="token">=</span> <span class="token6">4</span><span class="token1">;</span>
const COMPLAIN_FINISH <span class="token">=</span> <span class="token6">5</span><span class="token1">;</span>
public static $state <span class="token">=</span> <span class="token3">array</span><span class="token1">(</span>
<span class="token4">'1'</span> <span class="token">=</span><span class="token">></span> <span class="token4">'new'</span><span class="token1">,</span>
<span class="token4">'2'</span> <span class="token">=</span><span class="token">></span> <span class="token4">'appeal'</span><span class="token1">,</span><span class="token5">//投诉通过转给被投诉人</span>
<span class="token4">'3'</span> <span class="token">=</span><span class="token">></span> <span class="token4">'talk'</span><span class="token1">,</span><span class="token5">//被投诉人已申诉</span>
<span class="token4">'4'</span> <span class="token">=</span><span class="token">></span> <span class="token4">'handle'</span><span class="token1">,</span><span class="token5">//提交仲裁</span>
<span class="token4">'5'</span> <span class="token">=</span><span class="token">></span> <span class="token4">'finish'</span><span class="token1">,</span>
<span class="token1">)</span><span class="token1">;</span>
```
```
- 视图:根据URL获得参数act的值,判断视图
```
<pre class="calibre14">```
<span class="token2">if</span> <span class="token1">(</span>$act <span class="token">==</span> <span class="token4">"detail"</span><span class="token1">)</span>
<span class="token1">{</span>
$data <span class="token">=</span> $this<span class="token">-</span><span class="token">></span><span class="token3">detail</span><span class="token1">(</span><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">'detail'</span><span class="token1">)</span><span class="token1">;</span>
<span class="token1">}</span>
<span class="token2">else</span>
<span class="token1">{</span>
<span class="token5">//index.php(视图)</span>
<span class="token1">}</span>
```
```
1.投诉管理列表
视图:shop/views/default/Seller/Service/ComplainCtl/index.php
方法:index()
```
<pre class="calibre14">```
$data <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>complainBaseModel<span class="token">-</span><span class="token">></span><span class="token3">getBaseList</span><span class="token1">(</span>$cond_row<span class="token1">,</span> <span class="token3">array</span><span class="token1">(</span><span class="token4">'complain_datetime'</span> <span class="token">=</span><span class="token">></span> <span class="token4">'DESC'</span><span class="token1">)</span><span class="token1">,</span> $page<span class="token1">,</span> $rows<span class="token1">)</span><span class="token1">;</span>
```
```
2.查看投诉详情
视图:shop/views/default/Seller/Service/ComplainCtl/detail.php
方法:detail()
```
<pre class="calibre14">```
$data <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>complainBaseModel<span class="token">-</span><span class="token">></span><span class="token3">getComplainBase</span><span class="token1">(</span>$cond_row<span class="token1">)</span><span class="token1">;</span>
$data<span class="token1">[</span><span class="token4">'good'</span><span class="token1">]</span> <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>complainGoodsModel<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">"complain_id"</span> <span class="token">=</span><span class="token">></span> $complain_id<span class="token1">)</span><span class="token1">)</span><span class="token1">;</span>
```
```
六、用户投诉管理
1.投诉列表
文件路径:shop/controllers/Buyer/Service/ComplainCtl.php -> index()
视图:shop/views/default/Buyer/Service/ComplainCtl/index.php
```
<pre class="calibre14">```
$Yf_Page <span class="token">=</span> <span class="token2">new</span> <span class="token3">Yf_Page</span><span class="token1">(</span><span class="token1">)</span><span class="token1">;</span>
$Yf_Page<span class="token">-</span><span class="token">></span>listRows <span class="token">=</span> <span class="token6">10</span><span class="token1">;</span>
$rows <span class="token">=</span> $Yf_Page<span class="token">-</span><span class="token">></span>listRows<span class="token1">;</span>
$offset <span class="token">=</span> <span class="token3">request_int</span><span class="token1">(</span><span class="token4">'firstRow'</span><span class="token1">,</span> <span class="token6">0</span><span class="token1">)</span><span class="token1">;</span>
$page <span class="token">=</span> <span class="token3">ceil_r</span><span class="token1">(</span>$offset <span class="token">/</span> $rows<span class="token1">)</span><span class="token1">;</span>
$state <span class="token">=</span> <span class="token3">request_int</span><span class="token1">(</span><span class="token4">"status"</span><span class="token1">)</span><span class="token1">;</span>
$cond_row<span class="token1">[</span><span class="token4">'user_id_accuser'</span><span class="token1">]</span> <span class="token">=</span> Perm<span class="token1">:</span><span class="token1">:</span>$userId<span class="token1">;</span> <span class="token5">//店铺ID</span>
<span class="token2">if</span> <span class="token1">(</span>$state<span class="token1">)</span>
<span class="token1">{</span>
$cond_row<span class="token1">[</span><span class="token4">'complain_state'</span><span class="token1">]</span> <span class="token">=</span> $state<span class="token1">;</span>
<span class="token1">}</span>
$data <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>complainBaseModel<span class="token">-</span><span class="token">></span><span class="token3">getBaseList</span><span class="token1">(</span>$cond_row<span class="token1">,</span> <span class="token3">array</span><span class="token1">(</span><span class="token4">'complain_datetime'</span> <span class="token">=</span><span class="token">></span> <span class="token4">'DESC'</span><span class="token1">)</span><span class="token1">,</span> $page<span class="token1">,</span> $rows<span class="token1">)</span><span class="token1">;</span>
```
```
2.投诉详情
文件路径:shop/controllers/Buyer/Service/ComplainCtl.php
视图:shop/views/default/Buyer/Service/ComplainCtl/index.php
方法:detail()
```
<pre class="calibre15">```
<span class="token5">//根据获取到的act的值判断视图</span>
<span class="token2">if</span> <span class="token1">(</span>$act <span class="token">==</span> <span class="token4">"detail"</span><span class="token1">)</span>
<span class="token1">{</span>
$data <span class="token">=</span> $this<span class="token">-</span><span class="token">></span><span class="token3">detail</span><span class="token1">(</span><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">'detail'</span><span class="token1">)</span><span class="token1">;</span>
$d <span class="token">=</span> $data<span class="token1">;</span>
<span class="token1">}</span>
$data <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>complainBaseModel<span class="token">-</span><span class="token">></span><span class="token3">getComplainBase</span><span class="token1">(</span>$cond_row<span class="token1">)</span><span class="token1">;</span>
$data<span class="token1">[</span><span class="token4">'good'</span><span class="token1">]</span> <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>complainGoodsModel<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">"complain_id"</span> <span class="token">=</span><span class="token">></span> $complain_id<span class="token1">)</span><span class="token1">)</span><span class="token1">;</span>
$data<span class="token1">[</span><span class="token4">'id'</span><span class="token1">]</span> <span class="token">=</span> $complain_id<span class="token1">;</span>
$data<span class="token1">[</span><span class="token4">'order'</span><span class="token1">]</span> <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>orderBaseModel<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">'order_id'</span> <span class="token">=</span><span class="token">></span> $data<span class="token1">[</span><span class="token4">'good'</span><span class="token1">]</span><span class="token1">[</span><span class="token4">'order_id'</span><span class="token1">]</span><span class="token1">)</span><span class="token1">)</span><span class="token1">;</span>
$data<span class="token1">[</span><span class="token4">'ordergoods'</span><span class="token1">]</span> <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>orderGoodsModel<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">'order_goods_id'</span> <span class="token">=</span><span class="token">></span> $data<span class="token1">[</span><span class="token4">'good'</span><span class="token1">]</span><span class="token1">[</span><span class="token4">'order_goods_id'</span><span class="token1">]</span><span class="token1">)</span><span class="token1">)</span><span class="token1">;</span>
$data<span class="token1">[</span><span class="token4">'shop'</span><span class="token1">]</span> <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>shopBaseModel<span class="token">-</span><span class="token">></span><span class="token3">getOne</span><span class="token1">(</span>$data<span class="token1">[</span><span class="token4">'user_id_accused'</span><span class="token1">]</span><span class="token1">)</span><span class="token1">;</span>
$shop_company <span class="token">=</span> $this<span class="token">-</span><span class="token">></span>shopCompanyModel<span class="token">-</span><span class="token">></span><span class="token3">getOne</span><span class="token1">(</span>$data<span class="token1">[</span><span class="token4">'user_id_accused'</span><span class="token1">]</span><span class="token1">)</span><span class="token1">;</span>
$data<span class="token1">[</span><span class="token4">'shop'</span><span class="token1">]</span><span class="token1">[</span><span class="token4">'shop_company_address'</span><span class="token1">]</span> <span class="token">=</span> $shop_company<span class="token1">[</span><span class="token4">'shop_company_address'</span><span class="token1">]</span><span class="token1">;</span>
```
```
- 序言
- 系统要求
- 版本更新日志
- 远丰商城技术对接说明
- 开发指导
- 框架内容
- 基础
- 开发规范
- 目录结构
- 架构
- 架构总览
- 数据库
- 数据库连接
- 基本使用
- 缓存
- 配置
- 路由
- 数据字典
- ucenter
- shop
- paycenter
- ucenter_admin
- shop_admin
- paycenter_admin
- 通讯内容
- 商家中心
- 顶部导航栏
- 店铺信息栏
- 店铺及商品提示栏
- 交易提示栏
- 销售情况统计栏
- 单品销量排行栏
- 店铺运营推广栏
- 平台联系方式栏
- 订单物流
- 商品
- 商品列表
- 商品详情
- 商品发布与编辑
- 分销商品
- 关联版式
- 商品规格
- 图片空间
- 淘宝导入
- 订单流程
- 交易订单
- 订单退款/退货
- 促销
- 团购管理
- 加价购
- 限时折扣
- 满即送
- 代金券管理
- 分销
- 店铺
- 店铺设置
- 自销产品供应商
- 实体店铺
- 品牌申请
- 店铺信息
- 消费者保障服务
- 门店账号
- 分销商--产品供应商
- 分销明细
- 批发市场
- 售后服务
- 咨询管理
- 投诉管理
- 退款管理
- 退货管理
- 云方案架构
- 负载集群
- 云存储
- 接口
- Api接口说明
- 品牌
- 商品规格
- 商品类型
- 商品分类
- 商品
- 订单
- 商品/店铺收藏
- 足迹
- 退款及退货
- 商家店铺
- 会员
- 入驻协议
- 订单接口
- 商品接口
- 订单物流接口
- 商家中心接口
- 促销接口
- 快递鸟物流接口
- 代金券接口
- 首页版块
- 团购
- 平台红包
- 限时折扣接口
- 拼团接口
- wap首页模板
- 杂项
- 远程上传图片
- JS
- 银联支付
- 多语言
- 商品评分
- 图片加载
- 买家申请退款退货
- 商家退款退货
- 平台退款退货
- 添加发票
- 提交订单
- 确认订单
- 运费销售区域
- 获取会员地址
- 充值
- 导出XLS
- 商城系统集成
- 多语言实现
- 三级分销推广链接发展推广员
- app.ini.php
- 去分销
- 版本更新
- 物流支持
- 运营人员建议
- 业务逻辑
- 统计结算
- 客服消息
- 账号
- 三级分销
- IM
- 配置
- 平台帐号
- 活动数据表说明