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

修改购物车

... ... @@ -2,8 +2,8 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="e93f11c2-a7d9-4d35-8b1c-8dd18e7f5fef" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/application/api/controller/User.php" afterPath="$PROJECT_DIR$/application/api/controller/User.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/public/api.html" afterPath="$PROJECT_DIR$/public/api.html" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
... ... @@ -17,8 +17,8 @@
<file leaf-file-name="User.php" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/application/api/controller/User.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="394">
<caret line="797" column="19" lean-forward="true" selection-start-line="797" selection-start-column="19" selection-end-line="797" selection-end-column="19" />
<state relative-caret-position="695">
<caret line="762" column="43" lean-forward="true" selection-start-line="762" selection-start-column="43" selection-end-line="762" selection-end-column="43" />
<folding>
<element signature="e#38#68#0#PHP" expanded="true" />
<element signature="e#337#456#0#PHP" expanded="false" />
... ... @@ -51,18 +51,18 @@
<element signature="e#21466#21824#0#PHP" expanded="false" />
<element signature="e#21829#22019#0#PHP" expanded="false" />
<element signature="e#22025#23168#0#PHP" expanded="false" />
<element signature="e#23173#25838#0#PHP" expanded="false" />
<element signature="e#26429#27864#0#PHP" expanded="false" />
<element signature="e#27870#28404#0#PHP" expanded="false" />
<element signature="e#28409#29323#0#PHP" expanded="false" />
<element signature="e#29329#29860#0#PHP" expanded="false" />
<element signature="e#29865#30784#0#PHP" expanded="false" />
<element signature="e#30790#31439#0#PHP" expanded="false" />
<element signature="e#31444#32317#0#PHP" expanded="false" />
<element signature="e#32323#32918#0#PHP" expanded="false" />
<element signature="e#32923#37572#0#PHP" expanded="false" />
<element signature="e#37578#38144#0#PHP" expanded="false" />
<element signature="e#38149#40255#0#PHP" expanded="false" />
<element signature="e#25844#26342#0#PHP" expanded="false" />
<element signature="e#26347#27434#0#PHP" expanded="false" />
<element signature="e#27440#27974#0#PHP" expanded="false" />
<element signature="e#27979#28893#0#PHP" expanded="false" />
<element signature="e#28899#29430#0#PHP" expanded="false" />
<element signature="e#29435#30354#0#PHP" expanded="false" />
<element signature="e#30360#31009#0#PHP" expanded="false" />
<element signature="e#31014#31887#0#PHP" expanded="false" />
<element signature="e#31893#32488#0#PHP" expanded="false" />
<element signature="e#32493#37142#0#PHP" expanded="false" />
<element signature="e#37148#37714#0#PHP" expanded="false" />
<element signature="e#37719#39825#0#PHP" expanded="false" />
</folding>
</state>
</provider>
... ... @@ -141,9 +141,9 @@
<sorting>DEFINITION_ORDER</sorting>
</component>
<component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
<component name="ProjectFrameBounds">
<option name="x" value="196" />
<option name="y" value="50" />
<component name="ProjectFrameBounds" extendedState="1">
<option name="x" value="201" />
<option name="y" value="52" />
<option name="width" value="1699" />
<option name="height" value="1003" />
</component>
... ... @@ -238,7 +238,7 @@
<workItem from="1574146994475" duration="23222000" />
<workItem from="1574209189943" duration="37638000" />
<workItem from="1574252363848" duration="8841000" />
<workItem from="1574295812843" duration="9001000" />
<workItem from="1574295812843" duration="9738000" />
</task>
<task id="LOCAL-00001" summary="调试">
<created>1574145133364</created>
... ... @@ -251,7 +251,7 @@
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="127055000" />
<option name="totallyTimeSpent" value="127792000" />
</component>
<component name="TodoView">
<todo-panel id="selected-file">
... ... @@ -263,7 +263,8 @@
</todo-panel>
</component>
<component name="ToolWindowManager">
<frame x="196" y="50" width="1699" height="1003" extended-state="0" />
<frame x="201" y="52" width="1699" height="1003" 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.15253203" sideWeight="0.5" order="1" 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.32912987" sideWeight="0.5" order="9" side_tool="false" content_ui="tabs" />
... ... @@ -272,7 +273,7 @@
<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="1" 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="5" 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="2" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="true" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.14896074" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.14896074" sideWeight="0.5" order="2" 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="0" 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="6" 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="7" side_tool="false" content_ui="tabs" />
... ... @@ -315,7 +316,7 @@
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<option name="time" value="6" />
<option name="time" value="7" />
</breakpoint-manager>
<watches-manager />
</component>
... ... @@ -676,8 +677,8 @@
</entry>
<entry file="file://$PROJECT_DIR$/application/api/controller/User.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="394">
<caret line="797" column="19" lean-forward="true" selection-start-line="797" selection-start-column="19" selection-end-line="797" selection-end-column="19" />
<state relative-caret-position="695">
<caret line="762" column="43" lean-forward="true" selection-start-line="762" selection-start-column="43" selection-end-line="762" selection-end-column="43" />
<folding>
<element signature="e#38#68#0#PHP" expanded="true" />
<element signature="e#337#456#0#PHP" expanded="false" />
... ... @@ -710,18 +711,18 @@
<element signature="e#21466#21824#0#PHP" expanded="false" />
<element signature="e#21829#22019#0#PHP" expanded="false" />
<element signature="e#22025#23168#0#PHP" expanded="false" />
<element signature="e#23173#25838#0#PHP" expanded="false" />
<element signature="e#26429#27864#0#PHP" expanded="false" />
<element signature="e#27870#28404#0#PHP" expanded="false" />
<element signature="e#28409#29323#0#PHP" expanded="false" />
<element signature="e#29329#29860#0#PHP" expanded="false" />
<element signature="e#29865#30784#0#PHP" expanded="false" />
<element signature="e#30790#31439#0#PHP" expanded="false" />
<element signature="e#31444#32317#0#PHP" expanded="false" />
<element signature="e#32323#32918#0#PHP" expanded="false" />
<element signature="e#32923#37572#0#PHP" expanded="false" />
<element signature="e#37578#38144#0#PHP" expanded="false" />
<element signature="e#38149#40255#0#PHP" expanded="false" />
<element signature="e#25844#26342#0#PHP" expanded="false" />
<element signature="e#26347#27434#0#PHP" expanded="false" />
<element signature="e#27440#27974#0#PHP" expanded="false" />
<element signature="e#27979#28893#0#PHP" expanded="false" />
<element signature="e#28899#29430#0#PHP" expanded="false" />
<element signature="e#29435#30354#0#PHP" expanded="false" />
<element signature="e#30360#31009#0#PHP" expanded="false" />
<element signature="e#31014#31887#0#PHP" expanded="false" />
<element signature="e#31893#32488#0#PHP" expanded="false" />
<element signature="e#32493#37142#0#PHP" expanded="false" />
<element signature="e#37148#37714#0#PHP" expanded="false" />
<element signature="e#37719#39825#0#PHP" expanded="false" />
</folding>
</state>
</provider>
... ...
... ... @@ -792,7 +792,6 @@ class User extends Api
*
* @ApiParams (name="pic_id", type="inter", required=false, description="图片ID")
* @ApiParams (name="video_id", type="inter", required=false, description="视频ID")
* @ApiParams (name="total", type="float", required=true, description="价格")
*
*
* @ApiReturn({
... ... @@ -806,16 +805,9 @@ class User extends Api
$user_id = $this->uid;
$pic_id = $this->request->param('pic_id');
$video_id = $this->request->param('video_id');
$total = $this->request->post('total');
if(empty( $total)){
$this->error(['code'=>2,'msg'=>'缺少必要参数']);
}elseif ( $total<=0){
$this->error(['code'=>3,'msg'=>'非法操作']);
}
if(empty($pic_id)){
$param['video_id'] = $this->request->param('video_id');
$param['createtime'] = time();
$param['total'] = $this->request->param('total');
$param['user_id'] = $user_id;
$data = Db::name('car')
->insertGetId($param);
... ... @@ -827,7 +819,6 @@ class User extends Api
}elseif (empty($video_id)){
$param['pic_id'] = $this->request->param('pic_id');
$param['createtime'] = time();
$param['total'] = $this->request->param('total');
$param['user_id'] = $user_id;
$data = Db::name('car')
->insertGetId($param);
... ...