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

修改图片列表

... ... @@ -2,15 +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/admin/controller/Pic.php" afterPath="$PROJECT_DIR$/application/admin/controller/Pic.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/application/admin/lang/zh-cn/pic.php" afterPath="$PROJECT_DIR$/application/admin/lang/zh-cn/pic.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/application/admin/view/pic/add.html" afterPath="$PROJECT_DIR$/application/admin/view/pic/add.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/application/admin/view/pic/edit.html" afterPath="$PROJECT_DIR$/application/admin/view/pic/edit.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/application/admin/view/type/edit.html" afterPath="$PROJECT_DIR$/application/admin/view/type/edit.html" />
<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" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/public/assets/js/backend/pic.js" afterPath="$PROJECT_DIR$/public/assets/js/backend/pic.js" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
... ... @@ -24,56 +17,62 @@
<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="63">
<caret line="172" column="7" lean-forward="false" selection-start-line="172" selection-start-column="7" selection-end-line="172" selection-end-column="7" />
<state relative-caret-position="295">
<caret line="327" column="0" lean-forward="true" selection-start-line="327" selection-start-column="0" selection-end-line="327" selection-end-column="0" />
<folding>
<element signature="e#2902#3430#0#PHP" expanded="false" />
<element signature="e#3435#4571#0#PHP" expanded="false" />
<element signature="e#4577#4984#0#PHP" expanded="false" />
<element signature="e#4989#5332#0#PHP" expanded="false" />
<element signature="e#5338#5751#0#PHP" expanded="false" />
<element signature="e#6112#6949#0#PHP" expanded="false" />
<element signature="e#6954#9149#0#PHP" expanded="false" />
<element signature="e#9155#9800#0#PHP" expanded="false" />
<element signature="e#22993#23498#0#PHP" expanded="false" />
<element signature="e#23503#23754#0#PHP" expanded="false" />
<element signature="e#23760#24239#0#PHP" expanded="false" />
<element signature="e#24244#25001#0#PHP" expanded="false" />
<element signature="e#25007#25488#0#PHP" expanded="false" />
<element signature="e#25493#26263#0#PHP" expanded="false" />
<element signature="e#26269#26632#0#PHP" expanded="false" />
<element signature="e#26637#26828#0#PHP" expanded="false" />
<element signature="e#26834#27192#0#PHP" expanded="false" />
<element signature="e#27197#27388#0#PHP" expanded="false" />
<element signature="e#27394#28537#0#PHP" expanded="false" />
<element signature="e#28542#31207#0#PHP" expanded="false" />
<element signature="e#31213#31711#0#PHP" expanded="false" />
<element signature="e#31716#33462#0#PHP" expanded="false" />
<element signature="e#33468#33881#0#PHP" expanded="false" />
<element signature="e#33886#34365#0#PHP" expanded="false" />
<element signature="e#34371#34905#0#PHP" expanded="false" />
<element signature="e#34910#36295#0#PHP" expanded="false" />
<element signature="e#36301#36955#0#PHP" expanded="false" />
<element signature="e#36960#38975#0#PHP" expanded="false" />
<element signature="e#38981#39741#0#PHP" expanded="false" />
<element signature="e#39746#42455#0#PHP" expanded="false" />
<element signature="e#42481#43312#0#PHP" expanded="false" />
<element signature="e#43318#43738#0#PHP" expanded="false" />
<element signature="e#43743#44226#0#PHP" expanded="false" />
<element signature="e#44232#45038#0#PHP" expanded="false" />
<element signature="e#45043#48197#0#PHP" expanded="false" />
<element signature="e#48212#49540#0#PHP" expanded="false" />
<element signature="e#49556#50583#0#PHP" expanded="false" />
<element signature="e#50589#51347#0#PHP" expanded="false" />
<element signature="e#51352#55095#0#PHP" expanded="false" />
<element signature="e#55101#55493#0#PHP" expanded="false" />
<element signature="e#55498#56450#0#PHP" expanded="false" />
<element signature="e#56474#57047#0#PHP" expanded="false" />
<element signature="e#57053#57652#0#PHP" expanded="false" />
<element signature="e#57657#58584#0#PHP" expanded="false" />
<element signature="e#58590#59304#0#PHP" expanded="false" />
<element signature="e#59310#59737#0#PHP" expanded="false" />
<element signature="e#59742#60211#0#PHP" expanded="false" />
<element signature="e#5756#6104#0#PHP" expanded="false" />
<element signature="e#6110#6947#0#PHP" expanded="false" />
<element signature="e#6952#9147#0#PHP" expanded="false" />
<element signature="e#9153#9833#0#PHP" expanded="false" />
<element signature="e#9838#10691#0#PHP" expanded="false" />
<element signature="e#10697#11486#0#PHP" expanded="false" />
<element signature="e#11491#12839#0#PHP" expanded="false" />
<element signature="e#12845#13547#0#PHP" expanded="false" />
<element signature="e#13552#14752#0#PHP" expanded="false" />
<element signature="e#22783#23288#0#PHP" expanded="false" />
<element signature="e#23293#23544#0#PHP" expanded="false" />
<element signature="e#23550#24029#0#PHP" expanded="false" />
<element signature="e#24034#24791#0#PHP" expanded="false" />
<element signature="e#24797#25278#0#PHP" expanded="false" />
<element signature="e#25283#26053#0#PHP" expanded="false" />
<element signature="e#26059#26422#0#PHP" expanded="false" />
<element signature="e#26427#26618#0#PHP" expanded="false" />
<element signature="e#26624#26982#0#PHP" expanded="false" />
<element signature="e#26987#27178#0#PHP" expanded="false" />
<element signature="e#27184#28327#0#PHP" expanded="false" />
<element signature="e#28332#30997#0#PHP" expanded="false" />
<element signature="e#31003#31501#0#PHP" expanded="false" />
<element signature="e#31506#33252#0#PHP" expanded="false" />
<element signature="e#33258#33671#0#PHP" expanded="false" />
<element signature="e#33676#34155#0#PHP" expanded="false" />
<element signature="e#34161#34695#0#PHP" expanded="false" />
<element signature="e#34700#36085#0#PHP" expanded="false" />
<element signature="e#36091#36745#0#PHP" expanded="false" />
<element signature="e#36750#38765#0#PHP" expanded="false" />
<element signature="e#38771#39531#0#PHP" expanded="false" />
<element signature="e#39536#42245#0#PHP" expanded="false" />
<element signature="e#42271#43102#0#PHP" expanded="false" />
<element signature="e#43108#43528#0#PHP" expanded="false" />
<element signature="e#43533#44016#0#PHP" expanded="false" />
<element signature="e#44022#44828#0#PHP" expanded="false" />
<element signature="e#44833#47987#0#PHP" expanded="false" />
<element signature="e#48002#49330#0#PHP" expanded="false" />
<element signature="e#49346#50373#0#PHP" expanded="false" />
<element signature="e#50379#51137#0#PHP" expanded="false" />
<element signature="e#51142#54885#0#PHP" expanded="false" />
<element signature="e#54891#55283#0#PHP" expanded="false" />
<element signature="e#55288#56240#0#PHP" expanded="false" />
<element signature="e#56264#56837#0#PHP" expanded="false" />
<element signature="e#56843#57442#0#PHP" expanded="false" />
<element signature="e#57447#58374#0#PHP" expanded="false" />
<element signature="e#58380#59094#0#PHP" expanded="false" />
<element signature="e#59100#59527#0#PHP" expanded="false" />
<element signature="e#59532#60001#0#PHP" expanded="false" />
</folding>
</state>
</provider>
... ... @@ -166,8 +165,8 @@
</component>
<component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
<component name="ProjectFrameBounds">
<option name="x" value="319" />
<option name="y" value="56" />
<option name="x" value="259" />
<option name="y" value="63" />
<option name="width" value="1700" />
<option name="height" value="1000" />
</component>
... ... @@ -297,7 +296,7 @@
<workItem from="1575541798312" duration="2359000" />
<workItem from="1575592025964" duration="640000" />
<workItem from="1575599624364" duration="95000" />
<workItem from="1575680867057" duration="4648000" />
<workItem from="1575680867057" duration="5509000" />
</task>
<task id="LOCAL-00001" summary="调试">
<created>1574145133364</created>
... ... @@ -310,7 +309,7 @@
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="314547000" />
<option name="totallyTimeSpent" value="315408000" />
</component>
<component name="TodoView">
<todo-panel id="selected-file">
... ... @@ -322,7 +321,8 @@
</todo-panel>
</component>
<component name="ToolWindowManager">
<frame x="319" y="56" width="1700" height="1000" extended-state="0" />
<frame x="259" y="63" width="1700" height="1000" 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.19512194" 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" />
... ... @@ -331,7 +331,7 @@
<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="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="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.10428737" 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.10428737" sideWeight="0.5" order="2" 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="6" 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="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" />
... ... @@ -771,56 +771,62 @@
</entry>
<entry file="file://$PROJECT_DIR$/application/api/controller/User.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="63">
<caret line="172" column="7" lean-forward="false" selection-start-line="172" selection-start-column="7" selection-end-line="172" selection-end-column="7" />
<state relative-caret-position="295">
<caret line="327" column="0" lean-forward="true" selection-start-line="327" selection-start-column="0" selection-end-line="327" selection-end-column="0" />
<folding>
<element signature="e#2902#3430#0#PHP" expanded="false" />
<element signature="e#3435#4571#0#PHP" expanded="false" />
<element signature="e#4577#4984#0#PHP" expanded="false" />
<element signature="e#4989#5332#0#PHP" expanded="false" />
<element signature="e#5338#5751#0#PHP" expanded="false" />
<element signature="e#6112#6949#0#PHP" expanded="false" />
<element signature="e#6954#9149#0#PHP" expanded="false" />
<element signature="e#9155#9800#0#PHP" expanded="false" />
<element signature="e#22993#23498#0#PHP" expanded="false" />
<element signature="e#23503#23754#0#PHP" expanded="false" />
<element signature="e#23760#24239#0#PHP" expanded="false" />
<element signature="e#24244#25001#0#PHP" expanded="false" />
<element signature="e#25007#25488#0#PHP" expanded="false" />
<element signature="e#25493#26263#0#PHP" expanded="false" />
<element signature="e#26269#26632#0#PHP" expanded="false" />
<element signature="e#26637#26828#0#PHP" expanded="false" />
<element signature="e#26834#27192#0#PHP" expanded="false" />
<element signature="e#27197#27388#0#PHP" expanded="false" />
<element signature="e#27394#28537#0#PHP" expanded="false" />
<element signature="e#28542#31207#0#PHP" expanded="false" />
<element signature="e#31213#31711#0#PHP" expanded="false" />
<element signature="e#31716#33462#0#PHP" expanded="false" />
<element signature="e#33468#33881#0#PHP" expanded="false" />
<element signature="e#33886#34365#0#PHP" expanded="false" />
<element signature="e#34371#34905#0#PHP" expanded="false" />
<element signature="e#34910#36295#0#PHP" expanded="false" />
<element signature="e#36301#36955#0#PHP" expanded="false" />
<element signature="e#36960#38975#0#PHP" expanded="false" />
<element signature="e#38981#39741#0#PHP" expanded="false" />
<element signature="e#39746#42455#0#PHP" expanded="false" />
<element signature="e#42481#43312#0#PHP" expanded="false" />
<element signature="e#43318#43738#0#PHP" expanded="false" />
<element signature="e#43743#44226#0#PHP" expanded="false" />
<element signature="e#44232#45038#0#PHP" expanded="false" />
<element signature="e#45043#48197#0#PHP" expanded="false" />
<element signature="e#48212#49540#0#PHP" expanded="false" />
<element signature="e#49556#50583#0#PHP" expanded="false" />
<element signature="e#50589#51347#0#PHP" expanded="false" />
<element signature="e#51352#55095#0#PHP" expanded="false" />
<element signature="e#55101#55493#0#PHP" expanded="false" />
<element signature="e#55498#56450#0#PHP" expanded="false" />
<element signature="e#56474#57047#0#PHP" expanded="false" />
<element signature="e#57053#57652#0#PHP" expanded="false" />
<element signature="e#57657#58584#0#PHP" expanded="false" />
<element signature="e#58590#59304#0#PHP" expanded="false" />
<element signature="e#59310#59737#0#PHP" expanded="false" />
<element signature="e#59742#60211#0#PHP" expanded="false" />
<element signature="e#5756#6104#0#PHP" expanded="false" />
<element signature="e#6110#6947#0#PHP" expanded="false" />
<element signature="e#6952#9147#0#PHP" expanded="false" />
<element signature="e#9153#9833#0#PHP" expanded="false" />
<element signature="e#9838#10691#0#PHP" expanded="false" />
<element signature="e#10697#11486#0#PHP" expanded="false" />
<element signature="e#11491#12839#0#PHP" expanded="false" />
<element signature="e#12845#13547#0#PHP" expanded="false" />
<element signature="e#13552#14752#0#PHP" expanded="false" />
<element signature="e#22783#23288#0#PHP" expanded="false" />
<element signature="e#23293#23544#0#PHP" expanded="false" />
<element signature="e#23550#24029#0#PHP" expanded="false" />
<element signature="e#24034#24791#0#PHP" expanded="false" />
<element signature="e#24797#25278#0#PHP" expanded="false" />
<element signature="e#25283#26053#0#PHP" expanded="false" />
<element signature="e#26059#26422#0#PHP" expanded="false" />
<element signature="e#26427#26618#0#PHP" expanded="false" />
<element signature="e#26624#26982#0#PHP" expanded="false" />
<element signature="e#26987#27178#0#PHP" expanded="false" />
<element signature="e#27184#28327#0#PHP" expanded="false" />
<element signature="e#28332#30997#0#PHP" expanded="false" />
<element signature="e#31003#31501#0#PHP" expanded="false" />
<element signature="e#31506#33252#0#PHP" expanded="false" />
<element signature="e#33258#33671#0#PHP" expanded="false" />
<element signature="e#33676#34155#0#PHP" expanded="false" />
<element signature="e#34161#34695#0#PHP" expanded="false" />
<element signature="e#34700#36085#0#PHP" expanded="false" />
<element signature="e#36091#36745#0#PHP" expanded="false" />
<element signature="e#36750#38765#0#PHP" expanded="false" />
<element signature="e#38771#39531#0#PHP" expanded="false" />
<element signature="e#39536#42245#0#PHP" expanded="false" />
<element signature="e#42271#43102#0#PHP" expanded="false" />
<element signature="e#43108#43528#0#PHP" expanded="false" />
<element signature="e#43533#44016#0#PHP" expanded="false" />
<element signature="e#44022#44828#0#PHP" expanded="false" />
<element signature="e#44833#47987#0#PHP" expanded="false" />
<element signature="e#48002#49330#0#PHP" expanded="false" />
<element signature="e#49346#50373#0#PHP" expanded="false" />
<element signature="e#50379#51137#0#PHP" expanded="false" />
<element signature="e#51142#54885#0#PHP" expanded="false" />
<element signature="e#54891#55283#0#PHP" expanded="false" />
<element signature="e#55288#56240#0#PHP" expanded="false" />
<element signature="e#56264#56837#0#PHP" expanded="false" />
<element signature="e#56843#57442#0#PHP" expanded="false" />
<element signature="e#57447#58374#0#PHP" expanded="false" />
<element signature="e#58380#59094#0#PHP" expanded="false" />
<element signature="e#59100#59527#0#PHP" expanded="false" />
<element signature="e#59532#60001#0#PHP" expanded="false" />
</folding>
</state>
</provider>
... ...
... ... @@ -201,8 +201,6 @@ class User extends Api
$this->success('SUCCESS',$data);
}
/**
* @ApiTitle (搜索页)
* @ApiSummary (搜索页)
... ... @@ -291,48 +289,40 @@ class User extends Api
* @ApiRoute (/api/user/pic)
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
*
* @ApiParams (name="type_id", type="inter", required=false, description="地区ID")
* @ApiParams (name="pictype_id", type="inter", required=false, description="类型ID")
* @ApiParams (name="page", type="inter", required=false, description="当前页(默认1)")
* @ApiParams (name="pageNum", type="inter", required=false, description="每页显示数据个数(默认10)")
* @ApiReturn({
"code": 1,
"msg": "成功",
"time": "1571492001",
"data": {
"id": 4,//图片id,
"thumbnail": //缩略图,
}
})
"code": 1,
"msg": "成功",
"time": "1571492001",
"data": {
"id": 4,//图片id,
"thumbnail": //缩略图,
}
})
*/
public function pic()
{
$rule = config('verify.path');
$page = $this->request->param('page',1,'intval');
$pageNum = $this->request->param('pageNum',10,'intval');
$type_id = $this->request->post('type_id');
if(empty($type_id)){
$data = Db::name('pic')
->field('id,thumbnail,title')
->order('id desc')
->page($page,$pageNum)
->select();
foreach ($data as &$v){
$v['thumbnail'] = $rule.$v['thumbnail'];
}
$this->success('SUCCESS',$data);
$page = $this->request->param('page', 1, 'intval');
$pageNum = $this->request->param('pageNum', 10, 'intval');
$pictype_id = $this->request->post('pictype_id');
if (empty($pictype_id)) {
$this->error(['code'=>2,'msg'=>'缺少必要参数']);
}else{
$type = ','.$type_id.',';
$where['type_ids'] = ['like',"%$type%"];
$pictype_id = ','.$pictype_id.',';
$where['pictype_ids'] = ['like',"%$pictype_id%"];
$data = Db::name('pic')
->where($where)
->field('id,thumbnail,title')
->where($where)
->order('id desc')
->page($page,$pageNum)
->page($page, $pageNum)
->select();
foreach ($data as &$v){
$v['thumbnail'] = $rule.$v['thumbnail'];
foreach ($data as &$v) {
$v['thumbnail'] = $rule . $v['thumbnail'];
}
$this->success('SUCCESS',$data);
$this->success('SUCCESS', $data);
}
}
... ...
... ... @@ -5923,10 +5923,10 @@
</thead>
<tbody>
<tr>
<td>type_id</td>
<td>pictype_id</td>
<td>inter</td>
<td></td>
<td>地区ID</td>
<td>类型ID</td>
</tr>
<tr>
<td>page</td>
... ... @@ -5970,8 +5970,8 @@
<div class="panel-body">
<form enctype="application/x-www-form-urlencoded" role="form" action="/api/user/pic" method="POST" name="form21" id="form21">
<div class="form-group">
<label class="control-label" for="type_id">type_id</label>
<input type="inter" class="form-control input-sm" id="type_id" placeholder="地区ID" name="type_id">
<label class="control-label" for="pictype_id">pictype_id</label>
<input type="inter" class="form-control input-sm" id="pictype_id" placeholder="类型ID" name="pictype_id">
</div>
<div class="form-group">
<label class="control-label" for="page">page</label>
... ... @@ -6013,14 +6013,14 @@
<div class="row">
<div class="col-md-12">
<pre id="sample_response21">{
"code": 1,
"msg": "成功",
"time": "1571492001",
"data": {
"id": 4,//图片id,
"thumbnail": //缩略图,
}
}</pre>
"code": 1,
"msg": "成功",
"time": "1571492001",
"data": {
"id": 4,//图片id,
"thumbnail": //缩略图,
}
}</pre>
</div>
</div>
</div><!-- #sample -->
... ... @@ -6612,7 +6612,7 @@
<div class="row mt0 footer">
<div class="col-md-6" align="left">
Generated on 2019-12-07 10:30:34 </div>
Generated on 2019-12-07 10:39:32 </div>
<div class="col-md-6" align="right">
<a href="https://www.fastadmin.net" target="_blank">FastAdmin</a>
</div>
... ...