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

修改添加建议

... ... @@ -2,6 +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" />
... ... @@ -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="257">
<caret line="786" column="14" lean-forward="true" selection-start-line="786" selection-start-column="14" selection-end-line="786" selection-end-column="14" />
<state relative-caret-position="294">
<caret line="1972" column="31" lean-forward="true" selection-start-line="1972" selection-start-column="31" selection-end-line="1972" selection-end-column="31" />
<folding>
<element signature="e#365#484#0#PHP" expanded="false" />
<element signature="e#490#1228#0#PHP" expanded="false" />
... ... @@ -49,6 +51,8 @@
<element signature="e#24308#24559#0#PHP" expanded="false" />
<element signature="e#24565#25044#0#PHP" expanded="false" />
<element signature="e#25049#25806#0#PHP" expanded="false" />
<element signature="e#25812#26293#0#PHP" expanded="false" />
<element signature="e#26298#27067#0#PHP" expanded="false" />
<element signature="e#27073#27436#0#PHP" expanded="false" />
<element signature="e#27441#27632#0#PHP" expanded="false" />
<element signature="e#27638#27996#0#PHP" expanded="false" />
... ... @@ -88,37 +92,8 @@
<element signature="e#62766#63120#1#PHP" expanded="false" />
<element signature="e#63959#64825#0#PHP" expanded="false" />
<element signature="e#64830#67365#0#PHP" expanded="false" />
<element signature="e#65025#65162#1#PHP" expanded="false" />
<element signature="e#65192#65332#1#PHP" expanded="false" />
<element signature="e#66002#66086#0#PHP" expanded="false" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="Pay.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/application/api/controller/Pay.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="709">
<caret line="643" column="48" lean-forward="true" selection-start-line="643" selection-start-column="48" selection-end-line="643" selection-end-column="48" />
<folding>
<element signature="e#706#1019#0#PHP" expanded="false" />
<element signature="e#1024#3100#0#PHP" expanded="false" />
<element signature="e#3106#3426#0#PHP" expanded="false" />
<element signature="e#3431#5513#0#PHP" expanded="false" />
<element signature="e#5519#5937#0#PHP" expanded="false" />
<element signature="e#5942#16036#0#PHP" expanded="false" />
<element signature="e#16042#16462#0#PHP" expanded="false" />
<element signature="e#16467#26491#0#PHP" expanded="false" />
<element signature="e#26508#26805#0#PHP" expanded="false" />
<element signature="e#26810#27203#0#PHP" expanded="false" />
<element signature="e#27230#30708#0#PHP" expanded="false" />
<element signature="e#33674#39605#0#PHP" expanded="false" />
<element signature="e#35490#38995#0#PHP" expanded="false" />
<element signature="e#37569#37956#0#PHP" expanded="false" />
<element signature="e#38017#38973#0#PHP" expanded="false" />
<element signature="e#39634#46806#0#PHP" expanded="false" />
<element signature="e#46829#47046#0#PHP" expanded="false" />
<element signature="e#67371#67880#0#PHP" expanded="false" />
</folding>
</state>
</provider>
... ... @@ -153,9 +128,6 @@
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/composer.json" />
<option value="$PROJECT_DIR$/public/assets/js/backend/user/user.js" />
<option value="$PROJECT_DIR$/application/admin/view/vip/index.html" />
<option value="$PROJECT_DIR$/public/assets/js/backend/vip.js" />
<option value="$PROJECT_DIR$/application/admin/view/order/index.html" />
<option value="$PROJECT_DIR$/application/admin/model/User.php" />
... ... @@ -202,8 +174,11 @@
<option value="$PROJECT_DIR$/application/admin/view/wonderful/edit.html" />
<option value="$PROJECT_DIR$/public/assets/js/backend/wonderful.js" />
<option value="$PROJECT_DIR$/application/admin/view/common/menu.html" />
<option value="$PROJECT_DIR$/application/api/controller/User.php" />
<option value="$PROJECT_DIR$/application/api/controller/Pay.php" />
<option value="$PROJECT_DIR$/application/admin/controller/Suggest.php" />
<option value="$PROJECT_DIR$/application/admin/view/suggest/index.html" />
<option value="$PROJECT_DIR$/public/assets/js/backend/suggest.js" />
<option value="$PROJECT_DIR$/application/api/controller/User.php" />
</list>
</option>
</component>
... ... @@ -221,11 +196,11 @@
<sorting>DEFINITION_ORDER</sorting>
</component>
<component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
<component name="ProjectFrameBounds" extendedState="7">
<option name="x" value="301" />
<option name="y" value="69" />
<component name="ProjectFrameBounds" extendedState="1">
<option name="x" value="71" />
<option name="y" value="82" />
<option name="width" value="1569" />
<option name="height" value="985" />
<option name="height" value="956" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1">
... ... @@ -242,6 +217,8 @@
<foldersAlwaysOnTop value="true" />
</navigator>
<panes>
<pane id="Scratches" />
<pane id="Scope" />
<pane id="ProjectPane">
<subPane>
<expand>
... ... @@ -271,8 +248,6 @@
<select />
</subPane>
</pane>
<pane id="Scratches" />
<pane id="Scope" />
</panes>
</component>
<component name="PropertiesComponent">
... ... @@ -366,7 +341,9 @@
<workItem from="1575937244447" duration="6285000" />
<workItem from="1575949803768" duration="5926000" />
<workItem from="1575959458925" duration="956000" />
<workItem from="1575979358020" duration="1998000" />
<workItem from="1575979358020" duration="2589000" />
<workItem from="1576028218954" duration="680000" />
<workItem from="1576128183316" duration="3096000" />
</task>
<task id="LOCAL-00001" summary="调试">
<created>1574145133364</created>
... ... @@ -393,7 +370,7 @@
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="388963000" />
<option name="totallyTimeSpent" value="393330000" />
</component>
<component name="TodoView">
<todo-panel id="selected-file">
... ... @@ -405,19 +382,19 @@
</todo-panel>
</component>
<component name="ToolWindowManager">
<frame x="-8" y="-8" width="1936" height="1056" extended-state="7" />
<frame x="71" y="82" width="1569" height="956" 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.17590618" sideWeight="0.5" order="1" side_tool="false" content_ui="combo" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.22332671" 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" />
<window_info id="Event Log" 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="0" side_tool="true" content_ui="tabs" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="0" 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="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="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.3599004" 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="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.47496948" 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" />
<window_info id="Message" 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="3" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.4" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
... ... @@ -463,63 +440,6 @@
<watches-manager />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/application/extra/verify.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="375">
<caret line="18" column="45" lean-forward="false" selection-start-line="18" selection-start-column="45" selection-end-line="18" selection-end-column="45" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/view/dashboard/index.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="75">
<caret line="3" column="22" lean-forward="true" selection-start-line="3" selection-start-column="22" selection-end-line="3" selection-end-column="22" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/database.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="100">
<caret line="18" column="101" lean-forward="false" selection-start-line="18" selection-start-column="56" selection-end-line="18" selection-end-column="101" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/public/admin.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/view/accredit/edit.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="375">
<caret line="15" column="10" lean-forward="true" selection-start-line="15" selection-start-column="10" selection-end-line="15" selection-end-column="10" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/view/accredit/add.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="375">
<caret line="15" column="10" lean-forward="false" selection-start-line="15" selection-start-column="10" selection-end-line="15" selection-end-column="10" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/public/assets/js/backend/accredit.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="250">
<caret line="25" column="41" lean-forward="true" selection-start-line="25" selection-start-column="41" selection-end-line="25" selection-end-column="41" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/view/accredit/index.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="250">
<caret line="13" column="0" lean-forward="true" selection-start-line="13" selection-start-column="0" selection-end-line="13" selection-end-column="0" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/controller/Accredit.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-283">
... ... @@ -650,13 +570,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/public/assets/js/backend/order.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1125">
<caret line="45" column="34" lean-forward="true" selection-start-line="45" selection-start-column="34" selection-end-line="45" selection-end-column="34" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/controller/Order.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="235">
... ... @@ -889,13 +802,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/public/assets/js/backend/pic.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="400">
<caret line="33" column="144" lean-forward="true" selection-start-line="33" selection-start-column="24" selection-end-line="33" selection-end-column="144" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/view/pic/add.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="203">
... ... @@ -1003,8 +909,8 @@
</entry>
<entry file="file://$PROJECT_DIR$/application/api/controller/Pay.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="709">
<caret line="643" column="48" lean-forward="true" selection-start-line="643" selection-start-column="48" selection-end-line="643" selection-end-column="48" />
<state relative-caret-position="673">
<caret line="624" column="40" lean-forward="false" selection-start-line="624" selection-start-column="40" selection-end-line="624" selection-end-column="40" />
<folding>
<element signature="e#706#1019#0#PHP" expanded="false" />
<element signature="e#1024#3100#0#PHP" expanded="false" />
... ... @@ -1017,6 +923,7 @@
<element signature="e#26508#26805#0#PHP" expanded="false" />
<element signature="e#26810#27203#0#PHP" expanded="false" />
<element signature="e#27230#30708#0#PHP" expanded="false" />
<element signature="e#30737#33641#0#PHP" expanded="false" />
<element signature="e#33674#39605#0#PHP" expanded="false" />
<element signature="e#35490#38995#0#PHP" expanded="false" />
<element signature="e#37569#37956#0#PHP" expanded="false" />
... ... @@ -1027,10 +934,94 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/api/controller/Notify.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding>
<element signature="e#510#3960#0#PHP" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/extra/verify.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
<caret line="0" column="0" lean-forward="false" selection-start-line="0" selection-start-column="0" selection-end-line="0" selection-end-column="0" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/library/traits/Backend.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="350">
<caret line="39" column="4" lean-forward="false" selection-start-line="39" selection-start-column="4" selection-end-line="69" selection-end-column="5" />
<folding>
<marker date="1562338656000" expanded="true" signature="13159:13266" ph="SELECT COLUM... COLUMNS" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/common/controller/Backend.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-2651">
<caret line="249" column="23" lean-forward="false" selection-start-line="249" selection-start-column="23" selection-end-line="249" selection-end-column="23" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/controller/Suggest.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="369">
<caret line="45" column="47" lean-forward="true" selection-start-line="45" selection-start-column="47" selection-end-line="45" selection-end-column="47" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/public/assets/js/backend/order.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="172">
<caret line="45" column="34" lean-forward="true" selection-start-line="45" selection-start-column="34" selection-end-line="45" selection-end-column="34" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/public/assets/js/backend/pic.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="25">
<caret line="33" column="144" lean-forward="true" selection-start-line="33" selection-start-column="24" selection-end-line="33" selection-end-column="144" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/public/assets/js/backend/accredit.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="300">
<caret line="30" column="24" lean-forward="true" selection-start-line="30" selection-start-column="24" selection-end-line="36" selection-end-column="26" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/public/assets/js/backend/suggest.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="469">
<caret line="35" column="55" lean-forward="false" selection-start-line="35" selection-start-column="55" selection-end-line="35" selection-end-column="55" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/view/suggest/index.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="275">
<caret line="11" column="24" lean-forward="false" selection-start-line="11" selection-start-column="24" selection-end-line="11" selection-end-column="24" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/api/controller/User.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="257">
<caret line="786" column="14" lean-forward="true" selection-start-line="786" selection-start-column="14" selection-end-line="786" selection-end-column="14" />
<state relative-caret-position="294">
<caret line="1972" column="31" lean-forward="true" selection-start-line="1972" selection-start-column="31" selection-end-line="1972" selection-end-column="31" />
<folding>
<element signature="e#365#484#0#PHP" expanded="false" />
<element signature="e#490#1228#0#PHP" expanded="false" />
... ... @@ -1062,6 +1053,8 @@
<element signature="e#24308#24559#0#PHP" expanded="false" />
<element signature="e#24565#25044#0#PHP" expanded="false" />
<element signature="e#25049#25806#0#PHP" expanded="false" />
<element signature="e#25812#26293#0#PHP" expanded="false" />
<element signature="e#26298#27067#0#PHP" expanded="false" />
<element signature="e#27073#27436#0#PHP" expanded="false" />
<element signature="e#27441#27632#0#PHP" expanded="false" />
<element signature="e#27638#27996#0#PHP" expanded="false" />
... ... @@ -1101,9 +1094,8 @@
<element signature="e#62766#63120#1#PHP" expanded="false" />
<element signature="e#63959#64825#0#PHP" expanded="false" />
<element signature="e#64830#67365#0#PHP" expanded="false" />
<element signature="e#65025#65162#1#PHP" expanded="false" />
<element signature="e#65192#65332#1#PHP" expanded="false" />
<element signature="e#66002#66086#0#PHP" expanded="false" />
<element signature="e#67371#67880#0#PHP" expanded="false" />
</folding>
</state>
</provider>
... ...
<?php
namespace app\admin\controller;
use app\common\controller\Backend;
/**
* 投诉与建议
*
* @icon fa fa-circle-o
*/
class Suggest extends Backend
{
/**
* Suggest模型对象
* @var \app\admin\model\Suggest
*/
protected $model = null;
public function _initialize()
{
parent::_initialize();
$this->model = new \app\admin\model\Suggest;
}
/**
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
*/
/**
* 查看
*/
public function index()
{
//当前是否为关联查询
$this->relationSearch = true;
//设置过滤方法
$this->request->filter(['strip_tags']);
if ($this->request->isAjax())
{
//如果发送的来源是Selectpage,则转发到Selectpage
if ($this->request->request('keyField'))
{
return $this->selectpage();
}
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
$total = $this->model
->with(['user'])
->where($where)
->order($sort, $order)
->count();
$list = $this->model
->with(['user'])
->where($where)
->order($sort, $order)
->limit($offset, $limit)
->select();
foreach ($list as $row) {
}
$list = collection($list)->toArray();
$result = array("total" => $total, "rows" => $list);
return json($result);
}
return $this->view->fetch();
}
}
... ...
<?php
return [
'Id' => 'ID',
'User_id' => '用户ID',
'Title' => '标题',
'Content' => '内容',
'Createtime' => '创建时间',
'User.id' => 'ID',
'User.group_id' => '组别ID',
'User.username' => '用户名',
'User.nickname' => '昵称',
'User.password' => '密码',
'User.salt' => '密码盐',
'User.email' => '电子邮箱',
'User.mobile' => '手机号',
'User.avatar' => '头像',
'User.level' => '等级',
'User.gender' => '性别',
'User.birthday' => '生日',
'User.bio' => '格言',
'User.money' => '余额',
'User.score' => '积分',
'User.successions' => '连续登录天数',
'User.maxsuccessions' => '最大连续登录天数',
'User.prevtime' => '上次登录时间',
'User.logintime' => '登录时间',
'User.loginip' => '登录IP',
'User.loginfailure' => '失败次数',
'User.joinip' => '加入IP',
'User.jointime' => '加入时间',
'User.createtime' => '创建时间',
'User.updatetime' => '更新时间',
'User.token' => 'Token',
'User.status' => '状态',
'User.verification' => '验证',
'User.openid' => 'openid',
'User.is_vip' => '是否为会员(0否 1是)'
];
... ...
<?php
namespace app\admin\model;
use think\Model;
class Suggest extends Model
{
// 表名
protected $name = 'suggest';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'int';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = false;
protected $deleteTime = false;
// 追加属性
protected $append = [
];
public function user()
{
return $this->belongsTo('User', 'id', 'id', [], 'LEFT')->setEagerlyType(0);
}
}
... ...
<?php
namespace app\admin\validate;
use think\Validate;
class Suggest extends Validate
{
/**
* 验证规则
*/
protected $rule = [
];
/**
* 提示消息
*/
protected $message = [
];
/**
* 验证场景
*/
protected $scene = [
'add' => [],
'edit' => [],
];
}
... ...
<form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-title" class="form-control" name="row[title]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-content" class="form-control" name="row[content]" type="text">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>
... ...
<form id="edit-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('User_id')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-user_id" data-rule="required" data-source="user/user/index" data-field="nickname" class="form-control selectpage" name="row[user_id]" type="text" value="{$row.user_id|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Title')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-title" class="form-control" name="row[title]" type="text" value="{$row.title|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-content" class="form-control" name="row[content]" type="text" value="{$row.content|htmlentities}">
</div>
</div>
<div class="form-group layer-footer">
<label class="control-label col-xs-12 col-sm-2"></label>
<div class="col-xs-12 col-sm-8">
<button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>
... ...
<div class="panel panel-default panel-intro">
{:build_heading()}
<div class="panel-body">
<div id="myTabContent" class="tab-content">
<div class="tab-pane fade active in" id="one">
<div class="widget-body no-padding">
<div id="toolbar" class="toolbar">
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}" ><i class="fa fa-refresh"></i> </a>
<!--<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('suggest/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>-->
<!--<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('suggest/edit')?'':'hide'}" title="{:__('Edit')}" ><i class="fa fa-pencil"></i> {:__('Edit')}</a>-->
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('suggest/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
<a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('suggest/import')?'':'hide'}" title="{:__('Import')}" id="btn-import-file" data-url="ajax/upload" data-mimetype="csv,xls,xlsx" data-multiple="false"><i class="fa fa-upload"></i> {:__('Import')}</a>
<div class="dropdown btn-group {:$auth->check('suggest/multi')?'':'hide'}">
<a class="btn btn-primary btn-more dropdown-toggle btn-disabled disabled" data-toggle="dropdown"><i class="fa fa-cog"></i> {:__('More')}</a>
<ul class="dropdown-menu text-left" role="menu">
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=normal"><i class="fa fa-eye"></i> {:__('Set to normal')}</a></li>
<li><a class="btn btn-link btn-multi btn-disabled disabled" href="javascript:;" data-params="status=hidden"><i class="fa fa-eye-slash"></i> {:__('Set to hidden')}</a></li>
</ul>
</div>
</div>
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
data-operate-edit="{:$auth->check('suggest/edit')}"
data-operate-del="{:$auth->check('suggest/del')}"
width="100%">
</table>
</div>
</div>
</div>
</div>
</div>
... ...
... ... @@ -1947,4 +1947,46 @@ class User extends Api
}
}
/**
* @ApiTitle (投诉与建议)
* @ApiSummary (投诉与建议)
* @ApiMethod (POST)
* @ApiRoute (/api/user/suggest)
*
* @ApiHeaders (name=token, type=string, required=true, description="请求的Token")
*
* @ApiParams (name="title", type="string", required=true, description="标题")
* @ApiParams (name="content", type="string", required=true, description="内容")
*
* @ApiReturn({
"code": 1,
"msg": "成功",
"time": "1571492001",
})
*/
public function suggest()
{
$param = $this->request->param();
$param['user_id'] = $this->uid;
$param['createtiem'] = time();
$validate = new Validate([
'title'=>'require',
'content'=>'require',
]);
$validate->message([
'title'=>'标题不能为空',
'content'=>'内容不能为空',
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
$data = Db::name('suggest')
->insertGetId($param);
if(!empty($data)){
$this->success('添加成功');
}else{
$this->error('sql运行失败');
}
}
}
... ...
此 diff 太大无法显示。
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
index_url: 'suggest/index' + location.search,
add_url: 'suggest/add',
edit_url: 'suggest/edit',
del_url: 'suggest/del',
multi_url: 'suggest/multi',
table: 'suggest',
}
});
var table = $("#table");
// 初始化表格
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'id',
sortName: 'id',
columns: [
[
{checkbox: true},
{field: 'id', title: __('Id')},
{field: 'user_id', title: __('User_id')},
{field: 'user.nickname', title: __('User.nickname')},
{field: 'title', title: __('Title')},
{field: 'content', title: __('Content')},
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: function (value, row, index) {
var that = $.extend({}, this);
var table = $(that.table).clone(true);
$(table).data("operate-edit", null);
that.table = table;
return Table.api.formatter.operate.call(that, value, row, index);
}}
]
]
});
// 为表格绑定事件
Table.api.bindevent(table);
},
add: function () {
Controller.api.bindevent();
},
edit: function () {
Controller.api.bindevent();
},
api: {
bindevent: function () {
Form.api.bindevent($("form[role=form]"));
}
}
};
return Controller;
});
\ No newline at end of file
... ...