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

修改购物车

... ... @@ -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="-927">
<caret line="1096" column="22" lean-forward="true" selection-start-line="1096" selection-start-column="22" selection-end-line="1096" selection-end-column="22" />
<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" />
<folding>
<element signature="e#38#68#0#PHP" expanded="true" />
<element signature="e#337#456#0#PHP" expanded="false" />
... ... @@ -52,16 +52,17 @@
<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#25844#26335#0#PHP" expanded="false" />
<element signature="e#26340#27427#0#PHP" expanded="false" />
<element signature="e#27433#27967#0#PHP" expanded="false" />
<element signature="e#27972#28886#0#PHP" expanded="false" />
<element signature="e#28892#29423#0#PHP" expanded="false" />
<element signature="e#29428#30347#0#PHP" expanded="false" />
<element signature="e#30353#31002#0#PHP" expanded="false" />
<element signature="e#31007#31880#0#PHP" expanded="false" />
<element signature="e#31886#32481#0#PHP" expanded="false" />
<element signature="e#32486#37135#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" />
</folding>
</state>
</provider>
... ... @@ -140,9 +141,9 @@
<sorting>DEFINITION_ORDER</sorting>
</component>
<component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
<component name="ProjectFrameBounds" extendedState="1">
<option name="x" value="200" />
<option name="y" value="55" />
<component name="ProjectFrameBounds">
<option name="x" value="196" />
<option name="y" value="50" />
<option name="width" value="1699" />
<option name="height" value="1003" />
</component>
... ... @@ -237,7 +238,7 @@
<workItem from="1574146994475" duration="23222000" />
<workItem from="1574209189943" duration="37638000" />
<workItem from="1574252363848" duration="8841000" />
<workItem from="1574295812843" duration="5650000" />
<workItem from="1574295812843" duration="9001000" />
</task>
<task id="LOCAL-00001" summary="调试">
<created>1574145133364</created>
... ... @@ -250,7 +251,7 @@
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="123704000" />
<option name="totallyTimeSpent" value="127055000" />
</component>
<component name="TodoView">
<todo-panel id="selected-file">
... ... @@ -262,7 +263,7 @@
</todo-panel>
</component>
<component name="ToolWindowManager">
<frame x="200" y="55" width="1699" height="1003" extended-state="1" />
<frame x="196" y="50" width="1699" height="1003" extended-state="0" />
<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" />
... ... @@ -314,7 +315,7 @@
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<option name="time" value="5" />
<option name="time" value="6" />
</breakpoint-manager>
<watches-manager />
</component>
... ... @@ -675,8 +676,8 @@
</entry>
<entry file="file://$PROJECT_DIR$/application/api/controller/User.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-927">
<caret line="1096" column="22" lean-forward="true" selection-start-line="1096" selection-start-column="22" selection-end-line="1096" selection-end-column="22" />
<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" />
<folding>
<element signature="e#38#68#0#PHP" expanded="true" />
<element signature="e#337#456#0#PHP" expanded="false" />
... ... @@ -710,16 +711,17 @@
<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#25844#26335#0#PHP" expanded="false" />
<element signature="e#26340#27427#0#PHP" expanded="false" />
<element signature="e#27433#27967#0#PHP" expanded="false" />
<element signature="e#27972#28886#0#PHP" expanded="false" />
<element signature="e#28892#29423#0#PHP" expanded="false" />
<element signature="e#29428#30347#0#PHP" expanded="false" />
<element signature="e#30353#31002#0#PHP" expanded="false" />
<element signature="e#31007#31880#0#PHP" expanded="false" />
<element signature="e#31886#32481#0#PHP" expanded="false" />
<element signature="e#32486#37135#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" />
</folding>
</state>
</provider>
... ...
... ... @@ -792,6 +792,8 @@ 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({
"code": 1,
... ... @@ -804,9 +806,16 @@ 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);
... ... @@ -818,6 +827,7 @@ 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);
... ...
... ... @@ -2398,6 +2398,12 @@
<td></td>
<td>视频ID</td>
</tr>
<tr>
<td>total</td>
<td>float</td>
<td></td>
<td>价格</td>
</tr>
</tbody>
</table>
</div>
... ... @@ -2436,6 +2442,10 @@
<input type="inter" class="form-control input-sm" id="video_id" placeholder="视频ID" name="video_id">
</div>
<div class="form-group">
<label class="control-label" for="total">total</label>
<input type="float" class="form-control input-sm" id="total" required placeholder="价格" name="total">
</div>
<div class="form-group">
<button type="submit" class="btn btn-success send" rel="26">提交</button>
<button type="reset" class="btn btn-info" rel="26">重置</button>
</div>
... ... @@ -4518,7 +4528,7 @@
<div class="row mt0 footer">
<div class="col-md-6" align="left">
Generated on 2019-11-21 10:52:11 </div>
Generated on 2019-11-21 15:20:58 </div>
<div class="col-md-6" align="right">
<a href="https://www.fastadmin.net" target="_blank">FastAdmin</a>
</div>
... ...