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

回收订单详情

... ... @@ -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="1057">
<caret line="283" column="9" lean-forward="true" selection-start-line="283" selection-start-column="9" selection-end-line="283" selection-end-column="9" />
<state relative-caret-position="198">
<caret line="370" column="0" lean-forward="false" selection-start-line="370" selection-start-column="0" selection-end-line="371" selection-end-column="0" />
<folding>
<element signature="e#366#715#0#PHP" expanded="false" />
<element signature="e#720#1485#0#PHP" expanded="false" />
... ... @@ -78,38 +78,40 @@
<element signature="e#4919#5120#0#PHP" expanded="false" />
<element signature="e#5126#5388#0#PHP" expanded="false" />
<element signature="e#5393#5598#0#PHP" expanded="false" />
<element signature="e#7850#8130#0#PHP" expanded="false" />
<element signature="e#8135#8527#0#PHP" expanded="false" />
<element signature="e#8533#9081#0#PHP" expanded="false" />
<element signature="e#9086#10285#0#PHP" expanded="false" />
<element signature="e#10291#10747#0#PHP" expanded="false" />
<element signature="e#10752#12015#0#PHP" expanded="false" />
<element signature="e#12038#12390#0#PHP" expanded="false" />
<element signature="e#12396#13080#0#PHP" expanded="false" />
<element signature="e#13085#14344#0#PHP" expanded="false" />
<element signature="e#14350#14811#0#PHP" expanded="false" />
<element signature="e#14816#17021#0#PHP" expanded="false" />
<element signature="e#17027#17636#0#PHP" expanded="false" />
<element signature="e#17641#18974#0#PHP" expanded="false" />
<element signature="e#18980#19337#0#PHP" expanded="false" />
<element signature="e#19342#20223#0#PHP" expanded="false" />
<element signature="e#20229#20581#0#PHP" expanded="false" />
<element signature="e#20586#21663#0#PHP" expanded="false" />
<element signature="e#21669#22024#0#PHP" expanded="false" />
<element signature="e#22029#23109#0#PHP" expanded="false" />
<element signature="e#23115#23539#0#PHP" expanded="false" />
<element signature="e#23544#24155#0#PHP" expanded="false" />
<element signature="e#24161#24657#0#PHP" expanded="false" />
<element signature="e#24662#25769#0#PHP" expanded="false" />
<element signature="e#25775#26059#0#PHP" expanded="false" />
<element signature="e#26064#26642#0#PHP" expanded="false" />
<element signature="e#26663#26982#0#PHP" expanded="false" />
<element signature="e#26988#27396#0#PHP" expanded="false" />
<element signature="e#27402#28161#0#PHP" expanded="false" />
<element signature="e#28181#29045#0#PHP" expanded="false" />
<element signature="e#29072#29472#0#PHP" expanded="false" />
<element signature="e#29496#30069#0#PHP" expanded="false" />
<element signature="e#30092#30902#0#PHP" expanded="false" />
<element signature="e#5604#6045#0#PHP" expanded="false" />
<element signature="e#6050#7361#0#PHP" expanded="false" />
<element signature="e#6196#7355#0#PHP" expanded="false" />
<element signature="e#7384#7915#0#PHP" expanded="false" />
<element signature="e#7921#8201#0#PHP" expanded="false" />
<element signature="e#8206#8598#0#PHP" expanded="false" />
<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#12731#13415#0#PHP" expanded="false" />
<element signature="e#13420#14679#0#PHP" expanded="false" />
<element signature="e#14685#15146#0#PHP" expanded="false" />
<element signature="e#15151#17356#0#PHP" expanded="false" />
<element signature="e#17362#17971#0#PHP" expanded="false" />
<element signature="e#17976#19309#0#PHP" expanded="false" />
<element signature="e#19315#19672#0#PHP" expanded="false" />
<element signature="e#20564#20916#0#PHP" expanded="false" />
<element signature="e#22026#22381#0#PHP" expanded="false" />
<element signature="e#22386#23466#0#PHP" expanded="false" />
<element signature="e#23472#23896#0#PHP" expanded="false" />
<element signature="e#23901#24512#0#PHP" expanded="false" />
<element signature="e#24518#25014#0#PHP" expanded="false" />
<element signature="e#25019#26126#0#PHP" expanded="false" />
<element signature="e#26132#26416#0#PHP" expanded="false" />
<element signature="e#26421#26999#0#PHP" expanded="false" />
<element signature="e#27020#27339#0#PHP" expanded="false" />
<element signature="e#27345#27753#0#PHP" expanded="false" />
<element signature="e#27759#28518#0#PHP" expanded="false" />
<element signature="e#28538#29402#0#PHP" expanded="false" />
<element signature="e#29429#29829#0#PHP" expanded="false" />
<element signature="e#29853#30426#0#PHP" expanded="false" />
<element signature="e#30449#31259#0#PHP" expanded="false" />
</folding>
</state>
</provider>
... ... @@ -204,10 +206,10 @@
</component>
<component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
<component name="ProjectFrameBounds">
<option name="x" value="310" />
<option name="y" value="12" />
<option name="x" value="316" />
<option name="y" value="90" />
<option name="width" value="1582" />
<option name="height" value="960" />
<option name="height" value="1009" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1">
... ... @@ -351,15 +353,15 @@
<workItem from="1575359408189" duration="10054000" />
<workItem from="1575419186725" duration="599000" />
<workItem from="1575420787741" duration="2879000" />
<workItem from="1575431441427" duration="4417000" />
<workItem from="1575431441427" duration="6582000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="449652000" />
<option name="totallyTimeSpent" value="451817000" />
</component>
<component name="ToolWindowManager">
<frame x="310" y="12" width="1582" height="960" extended-state="0" />
<frame x="316" y="90" width="1582" height="1009" 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.17214192" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
... ... @@ -857,8 +859,8 @@
</entry>
<entry file="file://$PROJECT_DIR$/api/index/controller/UserController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1057">
<caret line="283" column="9" lean-forward="true" selection-start-line="283" selection-start-column="9" selection-end-line="283" selection-end-column="9" />
<state relative-caret-position="198">
<caret line="370" column="0" lean-forward="false" selection-start-line="370" selection-start-column="0" selection-end-line="371" selection-end-column="0" />
<folding>
<element signature="e#366#715#0#PHP" expanded="false" />
<element signature="e#720#1485#0#PHP" expanded="false" />
... ... @@ -872,38 +874,40 @@
<element signature="e#4919#5120#0#PHP" expanded="false" />
<element signature="e#5126#5388#0#PHP" expanded="false" />
<element signature="e#5393#5598#0#PHP" expanded="false" />
<element signature="e#7850#8130#0#PHP" expanded="false" />
<element signature="e#8135#8527#0#PHP" expanded="false" />
<element signature="e#8533#9081#0#PHP" expanded="false" />
<element signature="e#9086#10285#0#PHP" expanded="false" />
<element signature="e#10291#10747#0#PHP" expanded="false" />
<element signature="e#10752#12015#0#PHP" expanded="false" />
<element signature="e#12038#12390#0#PHP" expanded="false" />
<element signature="e#12396#13080#0#PHP" expanded="false" />
<element signature="e#13085#14344#0#PHP" expanded="false" />
<element signature="e#14350#14811#0#PHP" expanded="false" />
<element signature="e#14816#17021#0#PHP" expanded="false" />
<element signature="e#17027#17636#0#PHP" expanded="false" />
<element signature="e#17641#18974#0#PHP" expanded="false" />
<element signature="e#18980#19337#0#PHP" expanded="false" />
<element signature="e#19342#20223#0#PHP" expanded="false" />
<element signature="e#20229#20581#0#PHP" expanded="false" />
<element signature="e#20586#21663#0#PHP" expanded="false" />
<element signature="e#21669#22024#0#PHP" expanded="false" />
<element signature="e#22029#23109#0#PHP" expanded="false" />
<element signature="e#23115#23539#0#PHP" expanded="false" />
<element signature="e#23544#24155#0#PHP" expanded="false" />
<element signature="e#24161#24657#0#PHP" expanded="false" />
<element signature="e#24662#25769#0#PHP" expanded="false" />
<element signature="e#25775#26059#0#PHP" expanded="false" />
<element signature="e#26064#26642#0#PHP" expanded="false" />
<element signature="e#26663#26982#0#PHP" expanded="false" />
<element signature="e#26988#27396#0#PHP" expanded="false" />
<element signature="e#27402#28161#0#PHP" expanded="false" />
<element signature="e#28181#29045#0#PHP" expanded="false" />
<element signature="e#29072#29472#0#PHP" expanded="false" />
<element signature="e#29496#30069#0#PHP" expanded="false" />
<element signature="e#30092#30902#0#PHP" expanded="false" />
<element signature="e#5604#6045#0#PHP" expanded="false" />
<element signature="e#6050#7361#0#PHP" expanded="false" />
<element signature="e#6196#7355#0#PHP" expanded="false" />
<element signature="e#7384#7915#0#PHP" expanded="false" />
<element signature="e#7921#8201#0#PHP" expanded="false" />
<element signature="e#8206#8598#0#PHP" expanded="false" />
<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#12731#13415#0#PHP" expanded="false" />
<element signature="e#13420#14679#0#PHP" expanded="false" />
<element signature="e#14685#15146#0#PHP" expanded="false" />
<element signature="e#15151#17356#0#PHP" expanded="false" />
<element signature="e#17362#17971#0#PHP" expanded="false" />
<element signature="e#17976#19309#0#PHP" expanded="false" />
<element signature="e#19315#19672#0#PHP" expanded="false" />
<element signature="e#20564#20916#0#PHP" expanded="false" />
<element signature="e#22026#22381#0#PHP" expanded="false" />
<element signature="e#22386#23466#0#PHP" expanded="false" />
<element signature="e#23472#23896#0#PHP" expanded="false" />
<element signature="e#23901#24512#0#PHP" expanded="false" />
<element signature="e#24518#25014#0#PHP" expanded="false" />
<element signature="e#25019#26126#0#PHP" expanded="false" />
<element signature="e#26132#26416#0#PHP" expanded="false" />
<element signature="e#26421#26999#0#PHP" expanded="false" />
<element signature="e#27020#27339#0#PHP" expanded="false" />
<element signature="e#27345#27753#0#PHP" expanded="false" />
<element signature="e#27759#28518#0#PHP" expanded="false" />
<element signature="e#28538#29402#0#PHP" expanded="false" />
<element signature="e#29429#29829#0#PHP" expanded="false" />
<element signature="e#29853#30426#0#PHP" expanded="false" />
<element signature="e#30449#31259#0#PHP" expanded="false" />
</folding>
</state>
</provider>
... ...
... ... @@ -273,6 +273,7 @@ class UserController extends RestBaseController
public function r_foreach($res){
foreach ($res as &$v){
$v['attr_id'] = explode(',',$v['attr_id']);
$v['create_time'] = date('Y-m-d H:i:s',$v['create_time']);
foreach ($v['attr_id'] as &$v1){
$v1 = Db::name('attr')
->alias('a')
... ... @@ -336,7 +337,7 @@ class UserController extends RestBaseController
*/
public function orderDetail()
{
// $user_id = $this->getUserId();
$user_id = $this->getUserId();
//接收订单ID
$id = $this->request->param('order_id');
... ... @@ -349,7 +350,8 @@ class UserController extends RestBaseController
$data['status'] = $res['status'];
$data['num'] = $res['num'];
$data['create_time'] = date('Y-m-d H:i:s',$res['create_time']);
$data['recycle_id'] = Db::name('recycle')->where('id',$res['recycle_id'])->column('address');
$recycle_id = Db::name('recycle')->where('id',$res['recycle_id'])->field('address')->find();
$data['recycle_id'] = $recycle_id['address'];
$data['attr_id'] = explode(',',$res['attr_id']);
foreach ($data['attr_id'] as &$v){
$v = Db::name('attr')
... ... @@ -359,10 +361,11 @@ class UserController extends RestBaseController
->field('a.attr_name,r.rgoods_name')
->find();
}
$data['sub_time'] = $res['sub_time'];
$data['image'] = explode(',',$res['image']);
$data['content'] = cmf_replace_content_file_url(htmlspecialchars_decode($res['content']));
$data['serve'] = Db::name('recyclefee')->where('id',1)->column('fee');
$serve = Db::name('recyclefee')->where('id',1)->field('fee')->find();
$data['serve'] = $serve['fee'];
$this->success('SUCCESS',$data);
}
... ... @@ -375,7 +378,7 @@ class UserController extends RestBaseController
*
* @header name:XX-Token require:1 default: desc:token
*
* @param name:status require:1 other desc:订单状态(不传或者为0是 已兑换,1已发货,2已完成)
* @param name:status require:1 other desc:订单状态(不传或者为1是 已兑换,2已发货,3已完成)
*
* @return id:订单ID
* @return num:订单号
... ... @@ -389,31 +392,35 @@ class UserController extends RestBaseController
{
$user_id = $this->getUserId();
$status = $this->request->param('status',0,'intval');
if(empty($status) || $status == 0){
if(empty($status) || $status == 1){
//已兑换的商城订单
$data = Db::name('shoporder')
->where('user_id',$user_id)
->where('status',0)
->where('status',1)
->field('id,number,create_time,num,shopgoods_id,total')
->select();
->select()
->toArray();
$this->success('success',$data);
$data = $this->s_foreach($data);
$this->success('SUCCESS',$data);
}elseif ($status == 1){
//已发货的商城订单
$data = Db::name('shoporder')
->where('user_id',$user_id)
->where('status',1)
->where('status',2)
->field('id,number,create_time,num,shopgoods_id,total')
->select();
->select()
->toArray();
$data = $this->s_foreach($data);
$this->success('SUCCESS',$data);
}elseif ($status == 2){
//已完成的商城订单
$data = Db::name('shoporder')
->where('user_id',$user_id)
->where('status',2)
->where('status',3)
->field('id,number,create_time,num,shopgoods_id,total')
->select();
->select()
->toArray();
$data = $this->s_foreach($data);
$this->success('SUCCESS',$data);
}
... ... @@ -675,17 +682,17 @@ class UserController extends RestBaseController
->find();
$attr_id = explode(',',$val['order_id']['attr_id']);
$val['order_id']['attr_id'] = [];
foreach ($attr_id as &$v1){
$v1 = Db::name('attr')
->alias('a')
->join('rgoods r','a.rgoods_id=r.id')
->field('r.rgoods_name')
->where('a.id',$v1)
->find();
array_push($val['order_id']['attr_id'],$v1['rgoods_name']);
}
$val['order_id']['attr_id'] = implode(',',$val['order_id']['attr_id']);
// $val['order_id']['attr_id'] = [];
// foreach ($attr_id as &$v1){
// $v1 = Db::name('attr')
// ->alias('a')
// ->join('rgoods r','a.rgoods_id=r.id')
// ->field('r.rgoods_name')
// ->where('a.id',$v1)
// ->find();
// array_push($val['order_id']['attr_id'],$v1['rgoods_name']);
// }
// $val['order_id']['attr_id'] = implode(',',$val['order_id']['attr_id']);
}
$this->success('success',$list);
... ...