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

修改添加购物车

... ... @@ -2,7 +2,9 @@
<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" />
... ... @@ -16,8 +18,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="450">
<caret line="492" column="13" lean-forward="false" selection-start-line="492" selection-start-column="13" selection-end-line="492" selection-end-column="13" />
<state relative-caret-position="295">
<caret line="780" column="33" lean-forward="true" selection-start-line="780" selection-start-column="33" selection-end-line="780" selection-end-column="33" />
<folding>
<element signature="e#38#68#0#PHP" expanded="true" />
<element signature="e#337#456#0#PHP" expanded="false" />
... ... @@ -36,6 +38,7 @@
<element signature="e#11641#12325#0#PHP" expanded="false" />
<element signature="e#12330#14120#0#PHP" expanded="false" />
<element signature="e#14126#14996#0#PHP" expanded="false" />
<element signature="e#15001#17018#0#PHP" expanded="false" />
<element signature="e#17024#17401#0#PHP" expanded="false" />
<element signature="e#17406#17670#0#PHP" expanded="false" />
<element signature="e#17676#18181#0#PHP" expanded="false" />
... ... @@ -49,7 +52,6 @@
<element signature="e#20814#21957#0#PHP" expanded="false" />
<element signature="e#21962#23939#0#PHP" expanded="false" />
<element signature="e#23945#24436#0#PHP" expanded="false" />
<element signature="e#24441#25189#0#PHP" expanded="false" />
</folding>
</state>
</provider>
... ... @@ -129,8 +131,8 @@
</component>
<component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
<component name="ProjectFrameBounds">
<option name="x" value="293" />
<option name="y" value="97" />
<option name="x" value="510" />
<option name="y" value="72" />
<option name="width" value="1614" />
<option name="height" value="977" />
</component>
... ... @@ -223,7 +225,7 @@
<workItem from="1574141466352" duration="745000" />
<workItem from="1574143209694" duration="3660000" />
<workItem from="1574146994475" duration="23222000" />
<workItem from="1574209189943" duration="22091000" />
<workItem from="1574209189943" duration="24458000" />
</task>
<task id="LOCAL-00001" summary="调试">
<created>1574145133364</created>
... ... @@ -236,7 +238,7 @@
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="93666000" />
<option name="totallyTimeSpent" value="96033000" />
</component>
<component name="TodoView">
<todo-panel id="selected-file">
... ... @@ -248,7 +250,7 @@
</todo-panel>
</component>
<component name="ToolWindowManager">
<frame x="293" y="97" width="1614" height="977" extended-state="0" />
<frame x="510" y="72" width="1614" height="977" 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.15701416" 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" />
... ... @@ -257,7 +259,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.3809524" 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.15119047" 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" />
... ... @@ -679,8 +681,8 @@
</entry>
<entry file="file://$PROJECT_DIR$/application/api/controller/User.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="450">
<caret line="492" column="13" lean-forward="false" selection-start-line="492" selection-start-column="13" selection-end-line="492" selection-end-column="13" />
<state relative-caret-position="295">
<caret line="780" column="33" lean-forward="true" selection-start-line="780" selection-start-column="33" selection-end-line="780" selection-end-column="33" />
<folding>
<element signature="e#38#68#0#PHP" expanded="true" />
<element signature="e#337#456#0#PHP" expanded="false" />
... ... @@ -699,6 +701,7 @@
<element signature="e#11641#12325#0#PHP" expanded="false" />
<element signature="e#12330#14120#0#PHP" expanded="false" />
<element signature="e#14126#14996#0#PHP" expanded="false" />
<element signature="e#15001#17018#0#PHP" expanded="false" />
<element signature="e#17024#17401#0#PHP" expanded="false" />
<element signature="e#17406#17670#0#PHP" expanded="false" />
<element signature="e#17676#18181#0#PHP" expanded="false" />
... ... @@ -712,7 +715,6 @@
<element signature="e#20814#21957#0#PHP" expanded="false" />
<element signature="e#21962#23939#0#PHP" expanded="false" />
<element signature="e#23945#24436#0#PHP" expanded="false" />
<element signature="e#24441#25189#0#PHP" expanded="false" />
</folding>
</state>
</provider>
... ...
... ... @@ -756,23 +756,35 @@ class User extends Api
$user_id = $this->uid;
$pic_id = $this->request->param('pic_id');
$video_id = $this->request->param('video_id');
$data = Db::name('car')
->field('id,user_id,pic_id,video_id')
->where('user_id',$user_id)
->find();
$param['pic_id'] = array_push(explode(',',$data['pic_id']),$pic_id);
$param['video_id'] = array_push(explode(',',$data['video_id']),$video_id);
$param['createtime'] = time();
$param['updatetime'] = time();
$data = Db::name('car')
->where('user_id',$user_id)
->update($param);
if($data){
$this->success('SUCCESS');
if(empty($data)){
$param['user_id'] = $user_id;
$param['createtime'] = time();
$param['pic_id'] = $pic_id;
$param['video_id'] = $video_id;
$data = Db::name('car')
->insertGetId($param);
if($data){
$this->success('SUCCESS');
}else{
$this->error(['code'=>2,'msg'=>'sql执行失败']);
}
}else{
$this->error(['code'=>2,'msg'=>'sql执行失败']);
$param['pic_id'] = $data['pic_id'].','.$pic_id;
$param['video_id'] = $data['video_id'].','.$video_id;
$param['updatetime'] = time();
$data = Db::name('car')
->where('user_id',$user_id)
->update($param);
if($data){
$this->success('SUCCESS');
}else{
$this->error(['code'=>2,'msg'=>'sql执行失败']);
}
}
}
}
... ...
... ... @@ -3116,7 +3116,7 @@
<div class="row mt0 footer">
<div class="col-md-6" align="left">
Generated on 2019-11-20 15:17:18 </div>
Generated on 2019-11-20 15:56:47 </div>
<div class="col-md-6" align="right">
<a href="https://www.fastadmin.net" target="_blank">FastAdmin</a>
</div>
... ...