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

修改商城订单

... ... @@ -63,8 +63,8 @@
<file leaf-file-name="UserController.php" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/api/index/controller/UserController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="430">
<caret line="482" column="53" lean-forward="false" selection-start-line="482" selection-start-column="53" selection-end-line="482" selection-end-column="53" />
<state relative-caret-position="555">
<caret line="418" column="35" lean-forward="true" selection-start-line="418" selection-start-column="35" selection-end-line="418" selection-end-column="35" />
<folding>
<element signature="e#366#715#0#PHP" expanded="false" />
<element signature="e#720#1485#0#PHP" expanded="false" />
... ... @@ -87,31 +87,32 @@
<element signature="e#8604#9152#0#PHP" expanded="false" />
<element signature="e#9157#10491#0#PHP" expanded="false" />
<element signature="e#10497#10953#0#PHP" expanded="false" />
<element signature="e#10958#12350#0#PHP" expanded="false" />
<element signature="e#12373#12725#0#PHP" expanded="false" />
<element signature="e#14738#15199#0#PHP" expanded="false" />
<element signature="e#15204#17409#0#PHP" expanded="false" />
<element signature="e#17415#18024#0#PHP" expanded="false" />
<element signature="e#18029#19362#0#PHP" expanded="false" />
<element signature="e#19368#19725#0#PHP" expanded="false" />
<element signature="e#19730#20611#0#PHP" expanded="false" />
<element signature="e#20617#20969#0#PHP" expanded="false" />
<element signature="e#20974#22052#0#PHP" expanded="false" />
<element signature="e#22058#22413#0#PHP" expanded="false" />
<element signature="e#22418#23498#0#PHP" expanded="false" />
<element signature="e#23504#23928#0#PHP" expanded="false" />
<element signature="e#23933#24544#0#PHP" expanded="false" />
<element signature="e#24550#25046#0#PHP" expanded="false" />
<element signature="e#25051#26158#0#PHP" expanded="false" />
<element signature="e#26164#26448#0#PHP" expanded="false" />
<element signature="e#26453#27031#0#PHP" expanded="false" />
<element signature="e#27052#27371#0#PHP" expanded="false" />
<element signature="e#27377#27785#0#PHP" expanded="false" />
<element signature="e#27791#28550#0#PHP" expanded="false" />
<element signature="e#28570#29434#0#PHP" expanded="false" />
<element signature="e#29461#29861#0#PHP" expanded="false" />
<element signature="e#29885#30458#0#PHP" expanded="false" />
<element signature="e#30481#31291#0#PHP" expanded="false" />
<element signature="e#12310#12665#0#PHP" expanded="false" />
<element signature="e#12671#13355#0#PHP" expanded="false" />
<element signature="e#13360#14672#0#PHP" expanded="false" />
<element signature="e#14678#15139#0#PHP" expanded="false" />
<element signature="e#15144#17349#0#PHP" expanded="false" />
<element signature="e#17355#17964#0#PHP" expanded="false" />
<element signature="e#17969#19302#0#PHP" expanded="false" />
<element signature="e#19308#19665#0#PHP" expanded="false" />
<element signature="e#19670#20551#0#PHP" expanded="false" />
<element signature="e#20557#20909#0#PHP" expanded="false" />
<element signature="e#20914#21992#0#PHP" expanded="false" />
<element signature="e#21998#22353#0#PHP" expanded="false" />
<element signature="e#22358#23438#0#PHP" expanded="false" />
<element signature="e#23444#23868#0#PHP" expanded="false" />
<element signature="e#23873#24484#0#PHP" expanded="false" />
<element signature="e#24490#24986#0#PHP" expanded="false" />
<element signature="e#24991#26098#0#PHP" expanded="false" />
<element signature="e#26104#26388#0#PHP" expanded="false" />
<element signature="e#26393#26971#0#PHP" expanded="false" />
<element signature="e#26992#27311#0#PHP" expanded="false" />
<element signature="e#27317#27725#0#PHP" expanded="false" />
<element signature="e#27731#28490#0#PHP" expanded="false" />
<element signature="e#28510#29374#0#PHP" expanded="false" />
<element signature="e#29401#29801#0#PHP" expanded="false" />
<element signature="e#29825#30398#0#PHP" expanded="false" />
<element signature="e#30421#31231#0#PHP" expanded="false" />
</folding>
</state>
</provider>
... ... @@ -206,8 +207,8 @@
</component>
<component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
<component name="ProjectFrameBounds" extendedState="1">
<option name="x" value="198" />
<option name="y" value="46" />
<option name="x" value="260" />
<option name="y" value="76" />
<option name="width" value="1582" />
<option name="height" value="1021" />
</component>
... ... @@ -226,8 +227,6 @@
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="Scratches" />
<pane id="Scope" />
<pane id="ProjectPane">
<subPane>
<expand>
... ... @@ -257,6 +256,8 @@
<select />
</subPane>
</pane>
<pane id="Scratches" />
<pane id="Scope" />
</panes>
</component>
<component name="PropertiesComponent">
... ... @@ -354,26 +355,27 @@
<workItem from="1575419186725" duration="599000" />
<workItem from="1575420787741" duration="2879000" />
<workItem from="1575431441427" duration="8414000" />
<workItem from="1575444399653" duration="1070000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="453649000" />
<option name="totallyTimeSpent" value="454719000" />
</component>
<component name="ToolWindowManager">
<frame x="198" y="46" width="1582" height="1021" extended-state="1" />
<frame x="260" y="76" width="1582" height="1021" extended-state="1" />
<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.17214192" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.174113" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32982457" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25086308" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
... ... @@ -859,8 +861,8 @@
</entry>
<entry file="file://$PROJECT_DIR$/api/index/controller/UserController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="430">
<caret line="482" column="53" lean-forward="false" selection-start-line="482" selection-start-column="53" selection-end-line="482" selection-end-column="53" />
<state relative-caret-position="555">
<caret line="418" column="35" lean-forward="true" selection-start-line="418" selection-start-column="35" selection-end-line="418" selection-end-column="35" />
<folding>
<element signature="e#366#715#0#PHP" expanded="false" />
<element signature="e#720#1485#0#PHP" expanded="false" />
... ... @@ -883,31 +885,32 @@
<element signature="e#8604#9152#0#PHP" expanded="false" />
<element signature="e#9157#10491#0#PHP" expanded="false" />
<element signature="e#10497#10953#0#PHP" expanded="false" />
<element signature="e#10958#12350#0#PHP" expanded="false" />
<element signature="e#12373#12725#0#PHP" expanded="false" />
<element signature="e#14738#15199#0#PHP" expanded="false" />
<element signature="e#15204#17409#0#PHP" expanded="false" />
<element signature="e#17415#18024#0#PHP" expanded="false" />
<element signature="e#18029#19362#0#PHP" expanded="false" />
<element signature="e#19368#19725#0#PHP" expanded="false" />
<element signature="e#19730#20611#0#PHP" expanded="false" />
<element signature="e#20617#20969#0#PHP" expanded="false" />
<element signature="e#20974#22052#0#PHP" expanded="false" />
<element signature="e#22058#22413#0#PHP" expanded="false" />
<element signature="e#22418#23498#0#PHP" expanded="false" />
<element signature="e#23504#23928#0#PHP" expanded="false" />
<element signature="e#23933#24544#0#PHP" expanded="false" />
<element signature="e#24550#25046#0#PHP" expanded="false" />
<element signature="e#25051#26158#0#PHP" expanded="false" />
<element signature="e#26164#26448#0#PHP" expanded="false" />
<element signature="e#26453#27031#0#PHP" expanded="false" />
<element signature="e#27052#27371#0#PHP" expanded="false" />
<element signature="e#27377#27785#0#PHP" expanded="false" />
<element signature="e#27791#28550#0#PHP" expanded="false" />
<element signature="e#28570#29434#0#PHP" expanded="false" />
<element signature="e#29461#29861#0#PHP" expanded="false" />
<element signature="e#29885#30458#0#PHP" expanded="false" />
<element signature="e#30481#31291#0#PHP" expanded="false" />
<element signature="e#12310#12665#0#PHP" expanded="false" />
<element signature="e#12671#13355#0#PHP" expanded="false" />
<element signature="e#13360#14672#0#PHP" expanded="false" />
<element signature="e#14678#15139#0#PHP" expanded="false" />
<element signature="e#15144#17349#0#PHP" expanded="false" />
<element signature="e#17355#17964#0#PHP" expanded="false" />
<element signature="e#17969#19302#0#PHP" expanded="false" />
<element signature="e#19308#19665#0#PHP" expanded="false" />
<element signature="e#19670#20551#0#PHP" expanded="false" />
<element signature="e#20557#20909#0#PHP" expanded="false" />
<element signature="e#20914#21992#0#PHP" expanded="false" />
<element signature="e#21998#22353#0#PHP" expanded="false" />
<element signature="e#22358#23438#0#PHP" expanded="false" />
<element signature="e#23444#23868#0#PHP" expanded="false" />
<element signature="e#23873#24484#0#PHP" expanded="false" />
<element signature="e#24490#24986#0#PHP" expanded="false" />
<element signature="e#24991#26098#0#PHP" expanded="false" />
<element signature="e#26104#26388#0#PHP" expanded="false" />
<element signature="e#26393#26971#0#PHP" expanded="false" />
<element signature="e#26992#27311#0#PHP" expanded="false" />
<element signature="e#27317#27725#0#PHP" expanded="false" />
<element signature="e#27731#28490#0#PHP" expanded="false" />
<element signature="e#28510#29374#0#PHP" expanded="false" />
<element signature="e#29401#29801#0#PHP" expanded="false" />
<element signature="e#29825#30398#0#PHP" expanded="false" />
<element signature="e#30421#31231#0#PHP" expanded="false" />
</folding>
</state>
</provider>
... ...
... ... @@ -397,28 +397,27 @@ class UserController extends RestBaseController
$data = Db::name('shoporder')
->where('user_id',$user_id)
->where('status',1)
->field('id,number,create_time,num,shopgoods_id,total')
->field('id,number,create_time,num,shopgoods_id')
->select()
->toArray();
$this->success('success',$data);
$data = $this->s_foreach($data);
$this->success('SUCCESS',$data);
}elseif ($status == 1){
}elseif ($status == 2){
//已发货的商城订单
$data = Db::name('shoporder')
->where('user_id',$user_id)
->where('status',2)
->field('id,number,create_time,num,shopgoods_id,total')
->field('id,number,create_time,num,shopgoods_id')
->select()
->toArray();
$data = $this->s_foreach($data);
$this->success('SUCCESS',$data);
}elseif ($status == 2){
}elseif ($status == 3){
//已完成的商城订单
$data = Db::name('shoporder')
->where('user_id',$user_id)
->where('status',3)
->field('id,number,create_time,num,shopgoods_id,total')
->field('id,number,create_time,num,shopgoods_id')
->select()
->toArray();
$data = $this->s_foreach($data);
... ... @@ -429,11 +428,11 @@ class UserController extends RestBaseController
//封装商城订单循环逻辑
public function s_foreach($res){
foreach ($res as &$v){
$v['create_time'] = date('Y-m-d H:i:s',$v['create_time']);
$v['shopgoods_id'] = Db::name('shopgoods')
->where('id',$v)
->field('goods_name,thumbnail')
->where('id',$v['shopgoods_id'])
->field('goods_name,thumbnail,price')
->find();
$v['thumbnail'] = cmf_get_image_preview_url($v['shopgoods_id']['thumbnail']);
}
return $res;
}
... ...