作者 郭盛
1 个管道 的构建 通过 耗费 0 秒

修改商品评价

... ... @@ -2,6 +2,7 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="0011664b-87e9-41bd-9f37-18792fb15777" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/api/index/controller/ShopgoodsController.php" afterPath="$PROJECT_DIR$/api/index/controller/ShopgoodsController.php" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
... ... @@ -72,8 +73,8 @@
<file leaf-file-name="ShopgoodsController.php" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/api/index/controller/ShopgoodsController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="327">
<caret line="115" column="25" lean-forward="true" selection-start-line="115" selection-start-column="25" selection-end-line="115" selection-end-column="25" />
<state relative-caret-position="232">
<caret line="270" column="0" lean-forward="true" selection-start-line="270" selection-start-column="0" selection-end-line="270" selection-end-column="0" />
<folding>
<element signature="e#411#604#0#PHP" expanded="false" />
<element signature="e#609#825#0#PHP" expanded="false" />
... ... @@ -81,37 +82,28 @@
<element signature="e#1334#2102#0#PHP" expanded="false" />
<element signature="e#2108#2326#0#PHP" expanded="false" />
<element signature="e#2331#2539#0#PHP" expanded="false" />
<element signature="e#2545#3052#0#PHP" expanded="false" />
<element signature="e#3057#3575#0#PHP" expanded="false" />
<element signature="e#3581#4093#0#PHP" expanded="false" />
<element signature="e#4098#4661#0#PHP" expanded="false" />
<element signature="e#4667#5164#0#PHP" expanded="false" />
<element signature="e#5169#6009#0#PHP" expanded="false" />
<element signature="e#6015#6333#0#PHP" expanded="false" />
<element signature="e#6338#6714#0#PHP" expanded="false" />
<element signature="e#6720#7075#0#PHP" expanded="false" />
<element signature="e#7080#7489#0#PHP" expanded="false" />
<element signature="e#7495#7880#0#PHP" expanded="false" />
<element signature="e#7885#8556#0#PHP" expanded="false" />
<element signature="e#8562#9008#0#PHP" expanded="false" />
<element signature="e#9013#9864#0#PHP" expanded="false" />
<element signature="e#9870#10140#0#PHP" expanded="false" />
<element signature="e#10145#10621#0#PHP" expanded="false" />
<element signature="e#10627#11187#0#PHP" expanded="false" />
<element signature="e#11192#12019#0#PHP" expanded="false" />
<element signature="e#5262#6260#0#PHP" expanded="false" />
<element signature="e#6266#6584#0#PHP" expanded="false" />
<element signature="e#6589#6965#0#PHP" expanded="false" />
<element signature="e#6971#7326#0#PHP" expanded="false" />
<element signature="e#7331#7740#0#PHP" expanded="false" />
<element signature="e#7746#8131#0#PHP" expanded="false" />
<element signature="e#8136#8807#0#PHP" expanded="false" />
<element signature="e#8813#9259#0#PHP" expanded="false" />
<element signature="e#9264#10115#0#PHP" expanded="false" />
<element signature="e#10121#10391#0#PHP" expanded="false" />
<element signature="e#10396#10872#0#PHP" expanded="false" />
<element signature="e#10878#11438#0#PHP" expanded="false" />
<element signature="e#11443#12270#0#PHP" expanded="false" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="ShopgoodsModel.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/api/index/model/ShopgoodsModel.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="381">
<caret line="30" column="9" lean-forward="true" selection-start-line="30" selection-start-column="9" selection-end-line="30" selection-end-column="9" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="RestBaseController.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/simplewind/cmf/controller/RestBaseController.php">
<provider selected="true" editor-type-id="text-editor">
... ... @@ -231,8 +223,8 @@
</component>
<component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
<component name="ProjectFrameBounds">
<option name="x" value="292" />
<option name="y" value="65" />
<option name="x" value="345" />
<option name="y" value="54" />
<option name="width" value="1582" />
<option name="height" value="969" />
</component>
... ... @@ -374,15 +366,15 @@
<workItem from="1575016153150" duration="3315000" />
<workItem from="1575246616478" duration="21722000" />
<workItem from="1575278769037" duration="7395000" />
<workItem from="1575332430854" duration="2151000" />
<workItem from="1575332430854" duration="3225000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="412609000" />
<option name="totallyTimeSpent" value="413683000" />
</component>
<component name="ToolWindowManager">
<frame x="292" y="65" width="1582" height="969" extended-state="0" />
<frame x="345" y="54" width="1582" height="969" extended-state="0" />
<editor active="true" />
<layout>
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.19513798" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
... ... @@ -824,16 +816,16 @@
</entry>
<entry file="file://$PROJECT_DIR$/api/index/model/ShopgoodsModel.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="381">
<caret line="30" column="9" lean-forward="true" selection-start-line="30" selection-start-column="9" selection-end-line="30" selection-end-column="9" />
<state relative-caret-position="106">
<caret line="13" column="34" lean-forward="true" selection-start-line="13" selection-start-column="34" selection-end-line="13" selection-end-column="34" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/api/index/controller/ShopgoodsController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="327">
<caret line="115" column="25" lean-forward="true" selection-start-line="115" selection-start-column="25" selection-end-line="115" selection-end-column="25" />
<state relative-caret-position="232">
<caret line="270" column="0" lean-forward="true" selection-start-line="270" selection-start-column="0" selection-end-line="270" selection-end-column="0" />
<folding>
<element signature="e#411#604#0#PHP" expanded="false" />
<element signature="e#609#825#0#PHP" expanded="false" />
... ... @@ -841,22 +833,23 @@
<element signature="e#1334#2102#0#PHP" expanded="false" />
<element signature="e#2108#2326#0#PHP" expanded="false" />
<element signature="e#2331#2539#0#PHP" expanded="false" />
<element signature="e#2545#3052#0#PHP" expanded="false" />
<element signature="e#3057#3575#0#PHP" expanded="false" />
<element signature="e#3581#4093#0#PHP" expanded="false" />
<element signature="e#4098#4661#0#PHP" expanded="false" />
<element signature="e#4667#5164#0#PHP" expanded="false" />
<element signature="e#5169#6009#0#PHP" expanded="false" />
<element signature="e#6015#6333#0#PHP" expanded="false" />
<element signature="e#6338#6714#0#PHP" expanded="false" />
<element signature="e#6720#7075#0#PHP" expanded="false" />
<element signature="e#7080#7489#0#PHP" expanded="false" />
<element signature="e#7495#7880#0#PHP" expanded="false" />
<element signature="e#7885#8556#0#PHP" expanded="false" />
<element signature="e#8562#9008#0#PHP" expanded="false" />
<element signature="e#9013#9864#0#PHP" expanded="false" />
<element signature="e#9870#10140#0#PHP" expanded="false" />
<element signature="e#10145#10621#0#PHP" expanded="false" />
<element signature="e#10627#11187#0#PHP" expanded="false" />
<element signature="e#11192#12019#0#PHP" expanded="false" />
<element signature="e#5262#6260#0#PHP" expanded="false" />
<element signature="e#6266#6584#0#PHP" expanded="false" />
<element signature="e#6589#6965#0#PHP" expanded="false" />
<element signature="e#6971#7326#0#PHP" expanded="false" />
<element signature="e#7331#7740#0#PHP" expanded="false" />
<element signature="e#7746#8131#0#PHP" expanded="false" />
<element signature="e#8136#8807#0#PHP" expanded="false" />
<element signature="e#8813#9259#0#PHP" expanded="false" />
<element signature="e#9264#10115#0#PHP" expanded="false" />
<element signature="e#10121#10391#0#PHP" expanded="false" />
<element signature="e#10396#10872#0#PHP" expanded="false" />
<element signature="e#10878#11438#0#PHP" expanded="false" />
<element signature="e#11443#12270#0#PHP" expanded="false" />
</folding>
</state>
</provider>
... ...
... ... @@ -172,6 +172,8 @@ class ShopgoodsController extends RestBaseController
* @url /index/Shopgoods/comment
* @method GET
*
* @header name:XX-Token require:1 default: desc:token
*
* @param name:shopgood_id type:int require:1 other: desc:商品id
* @param name:page type:int require:0 other: desc:当前页(默认1)
* @param name:pageNum type:int require:0 other: desc:每页显示数据个数(默认10)
... ... @@ -179,12 +181,14 @@ class ShopgoodsController extends RestBaseController
* @return id:评价id
* @return user_id:用户ID
* @return user_nickname:用户名
* @return avatar:用户头像
* @return num:评价星数
* @return content:评价内容
*
*/
public function comment()
{
$user_id = $this->getUserId();
$goods_id = $this->request->param('shopgood_id',0,'intval');
if(empty($goods_id)){
$this -> error(['code'=>40005,'msg'=>'缺少必要参数']);
... ... @@ -194,12 +198,13 @@ class ShopgoodsController extends RestBaseController
$res = Db::name('shopcomment')
->alias('a')
->join('user b','a.user_id = b.id')
->field('a.*,b.user_nickname')
->field('a.*,b.user_nickname,b.avatar')
->where('shopgood_id',$goods_id)
->page($page,$pageNum)
->select()
->toArray();
foreach ($res as &$v){
$v['content'] = strip_tags(cmf_replace_content_file_url(htmlspecialchars_decode($v['content'])));
$v['num'] = ceil(($v['speed']+$v['service']+$v['recycle'])/3);
$v['create_time'] = date('Y-m-d H:i:s',$v['create_time']);
}
... ...