作者 王晓刚
1 个管道 的构建 通过 耗费 9 秒

广告审核

... ... @@ -3,7 +3,7 @@
<component name="ChangeListManager">
<list default="true" id="309ad746-5b2a-4c29-af46-e7925a35765c" name="默认的" comment="">
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/application/admin/controller/UserMoneyLogAudit.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/admin/controller/UserMoneyLogAudit.php" afterDir="false" />
<change beforePath="$PROJECT_DIR$/application/admin/controller/MerchantGoods.php" beforeDir="false" afterPath="$PROJECT_DIR$/application/admin/controller/MerchantGoods.php" afterDir="false" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
... ... @@ -17,41 +17,20 @@
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="PayView.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/application/admin/controller/PayView.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="544">
<caret line="52" column="55" selection-start-line="52" selection-start-column="24" selection-end-line="52" selection-end-column="55" />
<folding>
<element signature="e#129#163#0#PHP" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="merchant_goods.js" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/public/assets/js/backend/merchant_goods.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2805">
<caret line="183" column="13" selection-start-line="183" selection-start-column="13" selection-end-line="183" selection-end-column="13" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="pay_view.js" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/public/assets/js/backend/pay_view.js">
<file leaf-file-name="WechatBase.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/application/common/controller/WechatBase.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1490">
<caret line="130" column="47" selection-start-line="130" selection-start-column="47" selection-end-line="130" selection-end-column="47" />
<state relative-caret-position="521">
<caret line="75" column="53" selection-start-line="75" selection-start-column="53" selection-end-line="75" selection-end-column="53" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="UserMoneyLogAudit.php" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/application/admin/controller/UserMoneyLogAudit.php">
<file leaf-file-name="MerchantGoods.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/application/admin/controller/MerchantGoods.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="504">
<caret line="130" column="25" lean-forward="true" selection-start-line="130" selection-start-column="25" selection-end-line="130" selection-end-column="25" />
<state relative-caret-position="-1360">
<caret line="55" column="13" selection-start-line="55" selection-start-column="13" selection-end-line="55" selection-end-column="13" />
<folding>
<element signature="e#40#74#0#PHP" expanded="true" />
</folding>
... ... @@ -59,56 +38,62 @@
</provider>
</entry>
</file>
<file leaf-file-name="wechat.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/application/extra/wechat.php">
<file leaf-file-name="Goods.php" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/application/admin/controller/Goods.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="833">
<caret line="49" column="65" selection-start-line="49" selection-start-column="65" selection-end-line="49" selection-end-column="65" />
<state relative-caret-position="340">
<caret line="20" column="106" selection-start-line="20" selection-start-column="106" selection-end-line="20" selection-end-column="106" />
<folding>
<element signature="e#40#74#0#PHP" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="WechatBase.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/application/common/controller/WechatBase.php">
<file leaf-file-name="GoodsAudit.php" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/application/admin/controller/GoodsAudit.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="504">
<caret line="74" column="43" selection-start-line="74" selection-start-column="37" selection-end-line="74" selection-end-column="43" />
<state relative-caret-position="136">
<caret line="20" column="4" lean-forward="true" selection-start-line="20" selection-start-column="4" selection-end-line="20" selection-end-column="106" />
<folding>
<element signature="e#40#74#0#PHP" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file leaf-file-name="index.html" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/application/admin/view/user_money_log_audit/index.html">
<entry file="file://$PROJECT_DIR$/application/admin/view/goods_audit/index.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="340">
<caret line="20" column="33" selection-start-line="14" selection-start-column="24" selection-end-line="20" selection-end-column="33" />
<state relative-caret-position="510">
<caret line="30" column="33" selection-start-line="24" selection-start-column="24" selection-end-line="30" selection-end-column="33" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="user_money_log_audit.js" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/public/assets/js/backend/user_money_log_audit.js">
<file leaf-file-name="goods.js" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/public/assets/js/backend/goods.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="646">
<caret line="38" column="71" selection-start-line="38" selection-start-column="71" selection-end-line="38" selection-end-column="71" />
<state relative-caret-position="-561">
<caret line="24" column="20" selection-start-line="24" selection-start-column="20" selection-end-line="146" selection-end-column="15" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="user_money_log.js" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/public/assets/js/backend/user_money_log.js">
<file leaf-file-name="goods_audit.js" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/public/assets/js/backend/goods_audit.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="544">
<caret line="32" column="165" selection-start-line="32" selection-start-column="69" selection-end-line="32" selection-end-column="165" />
<state relative-caret-position="476">
<caret line="28" column="53" selection-start-line="28" selection-start-column="39" selection-end-line="28" selection-end-column="53" />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="edit.html" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/application/admin/view/user_money_log_audit/edit.html">
<entry file="file://$PROJECT_DIR$/application/admin/view/goods/edit.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="402">
<caret line="24" column="33" selection-start-line="24" selection-start-column="33" selection-end-line="24" selection-end-column="33" />
<state relative-caret-position="3088">
<caret line="216" column="159" selection-start-line="216" selection-start-column="159" selection-end-line="216" selection-end-column="159" />
</state>
</provider>
</entry>
... ... @@ -132,16 +117,6 @@
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/application/home/controller/Share.php" />
<option value="$PROJECT_DIR$/application/home/controller/Member.php" />
<option value="$PROJECT_DIR$/.gitlab-ci.yml" />
<option value="$PROJECT_DIR$/application/home/model/User.php" />
<option value="$PROJECT_DIR$/application/common/controller/WechatBase.php" />
<option value="$PROJECT_DIR$/application/home/controller/Server.php" />
<option value="$PROJECT_DIR$/application/home/controller/User.php" />
<option value="$PROJECT_DIR$/application/home/controller/Index.php" />
<option value="$PROJECT_DIR$/application/admin/view/users/index.html" />
<option value="$PROJECT_DIR$/application/admin/controller/Users.php" />
<option value="$PROJECT_DIR$/application/admin/view/users/edit.html" />
<option value="$PROJECT_DIR$/application/admin/view/merchant/index.html" />
<option value="$PROJECT_DIR$/application/admin/controller/Merchant.php" />
... ... @@ -164,9 +139,7 @@
<option value="$PROJECT_DIR$/public/assets/js/backend/question.js" />
<option value="$PROJECT_DIR$/application/admin/controller/Question.php" />
<option value="$PROJECT_DIR$/application/admin/view/merchant_goods/add.html" />
<option value="$PROJECT_DIR$/public/assets/js/backend/merchant_goods.js" />
<option value="$PROJECT_DIR$/application/admin/view/merchant_goods/edit.html" />
<option value="$PROJECT_DIR$/application/admin/controller/MerchantGoods.php" />
<option value="$PROJECT_DIR$/application/home/controller/Question.php" />
<option value="$PROJECT_DIR$/public/assets/js/backend/wechat/pay.js" />
<option value="$PROJECT_DIR$/application/admin/view/pay/index.html" />
... ... @@ -183,6 +156,18 @@
<option value="$PROJECT_DIR$/application/admin/controller/PayView.php" />
<option value="$PROJECT_DIR$/application/extra/wechat.php" />
<option value="$PROJECT_DIR$/application/admin/controller/UserMoneyLogAudit.php" />
<option value="$PROJECT_DIR$/application/admin/view/goods/index.html" />
<option value="$PROJECT_DIR$/application/admin/view/goods/add.html" />
<option value="$PROJECT_DIR$/application/admin/model/Goods.php" />
<option value="$PROJECT_DIR$/public/assets/js/backend/merchant_goods.js" />
<option value="$PROJECT_DIR$/application/admin/view/goods/edit.html" />
<option value="$PROJECT_DIR$/application/admin/controller/MerchantGoods.php" />
<option value="$PROJECT_DIR$/public/assets/js/backend/goods.js" />
<option value="$PROJECT_DIR$/public/assets/js/backend/goods_audit.js" />
<option value="$PROJECT_DIR$/application/admin/model/GoodsAudit.php" />
<option value="$PROJECT_DIR$/application/admin/view/goods_audit/index.html" />
<option value="$PROJECT_DIR$/application/admin/controller/GoodsAudit.php" />
<option value="$PROJECT_DIR$/application/admin/controller/Goods.php" />
</list>
</option>
</component>
... ... @@ -273,18 +258,70 @@
<item name="advertising" type="b2602c69:ProjectViewProjectNode" />
<item name="advertising" type="462c0819:PsiDirectoryNode" />
<item name="application" type="462c0819:PsiDirectoryNode" />
<item name="extra" type="462c0819:PsiDirectoryNode" />
<item name="admin" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="advertising" type="b2602c69:ProjectViewProjectNode" />
<item name="advertising" type="462c0819:PsiDirectoryNode" />
<item name="application" type="462c0819:PsiDirectoryNode" />
<item name="admin" type="462c0819:PsiDirectoryNode" />
<item name="controller" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="advertising" type="b2602c69:ProjectViewProjectNode" />
<item name="advertising" type="462c0819:PsiDirectoryNode" />
<item name="application" type="462c0819:PsiDirectoryNode" />
<item name="admin" type="462c0819:PsiDirectoryNode" />
<item name="library" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="advertising" type="b2602c69:ProjectViewProjectNode" />
<item name="advertising" type="462c0819:PsiDirectoryNode" />
<item name="application" type="462c0819:PsiDirectoryNode" />
<item name="admin" type="462c0819:PsiDirectoryNode" />
<item name="library" type="462c0819:PsiDirectoryNode" />
<item name="traits" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="advertising" type="b2602c69:ProjectViewProjectNode" />
<item name="advertising" type="462c0819:PsiDirectoryNode" />
<item name="application" type="462c0819:PsiDirectoryNode" />
<item name="admin" type="462c0819:PsiDirectoryNode" />
<item name="view" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="advertising" type="b2602c69:ProjectViewProjectNode" />
<item name="advertising" type="462c0819:PsiDirectoryNode" />
<item name="application" type="462c0819:PsiDirectoryNode" />
<item name="admin" type="462c0819:PsiDirectoryNode" />
<item name="view" type="462c0819:PsiDirectoryNode" />
<item name="goods_audit" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="advertising" type="b2602c69:ProjectViewProjectNode" />
<item name="advertising" type="462c0819:PsiDirectoryNode" />
<item name="public" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="advertising" type="b2602c69:ProjectViewProjectNode" />
<item name="advertising" type="462c0819:PsiDirectoryNode" />
<item name="public" type="462c0819:PsiDirectoryNode" />
<item name="assets" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="advertising" type="b2602c69:ProjectViewProjectNode" />
<item name="advertising" type="462c0819:PsiDirectoryNode" />
<item name="public" type="462c0819:PsiDirectoryNode" />
<item name="assets" type="462c0819:PsiDirectoryNode" />
<item name="js" type="462c0819:PsiDirectoryNode" />
</path>
<path>
<item name="advertising" type="b2602c69:ProjectViewProjectNode" />
<item name="advertising" type="462c0819:PsiDirectoryNode" />
<item name="public" type="462c0819:PsiDirectoryNode" />
<item name="wechat" type="462c0819:PsiDirectoryNode" />
<item name="assets" type="462c0819:PsiDirectoryNode" />
<item name="js" type="462c0819:PsiDirectoryNode" />
<item name="backend" type="462c0819:PsiDirectoryNode" />
</path>
</expand>
<select />
... ... @@ -295,7 +332,7 @@
</component>
<component name="PropertiesComponent">
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="D:/phpStudy/WWW/zhaozhao" />
<property name="last_opened_file_path" value="D:/phpStudy/WWW/fresh" />
<property name="nodejs_interpreter_path.stuck_in_default_project" value="undefined stuck path" />
<property name="nodejs_npm_path_reset_for_default_project" value="true" />
<property name="settings.editor.selected.configurable" value="terminal" />
... ... @@ -348,7 +385,7 @@
<workItem from="1572087949120" duration="1641000" />
<workItem from="1572223206994" duration="28857000" />
<workItem from="1572309778506" duration="26117000" />
<workItem from="1572395935540" duration="10986000" />
<workItem from="1572395935540" duration="19055000" />
</task>
<task id="LOCAL-00001" summary="数据库配置">
<created>1571972429395</created>
... ... @@ -581,11 +618,18 @@
<option name="project" value="LOCAL" />
<updated>1572416277819</updated>
</task>
<option name="localTasksCounter" value="34" />
<task id="LOCAL-00034" summary="调试提现">
<created>1572417195136</created>
<option name="number" value="00034" />
<option name="presentableId" value="LOCAL-00034" />
<option name="project" value="LOCAL" />
<updated>1572417195136</updated>
</task>
<option name="localTasksCounter" value="35" />
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="196211000" />
<option name="totallyTimeSpent" value="204280000" />
</component>
<component name="ToolWindowManager">
<frame x="-8" y="-8" width="1936" height="1056" extended-state="6" />
... ... @@ -655,121 +699,9 @@
<option name="LAST_COMMIT_MESSAGE" value="调试提现" />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/application/admin/model/Question.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="510">
<caret line="42" column="48" selection-start-line="42" selection-start-column="48" selection-end-line="42" selection-end-column="48" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/view/question/index.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="170">
<caret line="10" column="58" selection-start-line="10" selection-start-column="58" selection-end-line="10" selection-end-column="58" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/thinkphp/library/think/Response.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="289">
<caret line="69" column="27" selection-start-line="69" selection-start-column="27" selection-end-line="69" selection-end-column="27" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/thinkphp/library/traits/controller/Jump.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="561">
<caret line="61" column="33" selection-start-line="61" selection-start-column="33" selection-end-line="61" selection-end-column="33" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/database.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="170">
<caret line="18" column="78" selection-start-line="18" selection-start-column="78" selection-end-line="18" selection-end-column="78" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/view/question/add.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="510">
<caret line="30" column="50" selection-start-line="30" selection-start-column="36" selection-end-line="30" selection-end-column="50" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/view/example/bootstraptable/detail.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="323">
<caret line="19" column="29" selection-start-line="19" selection-start-column="29" selection-end-line="19" selection-end-column="29" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/controller/MerchantGoods.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="487">
<caret line="294" column="21" selection-start-line="294" selection-start-column="21" selection-end-line="294" selection-end-column="21" />
<folding>
<element signature="e#40#74#0#PHP" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/controller/Question.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="912">
<caret line="103" column="52" selection-start-line="103" selection-start-column="52" selection-end-line="103" selection-end-column="52" />
<folding>
<element signature="e#40#74#0#PHP" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/view/merchant_goods/edit.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="657">
<caret line="244" column="70" selection-start-line="244" selection-start-column="70" selection-end-line="244" selection-end-column="70" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/view/question/edit.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="136">
<caret line="8" column="53" selection-start-line="8" selection-start-column="50" selection-end-line="8" selection-end-column="53" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/public/assets/js/backend/question.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="884">
<caret line="52" column="40" selection-start-line="52" selection-start-column="40" selection-end-line="52" selection-end-column="40" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/home/controller/Collect.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-102" />
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/home/controller/Question.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="306">
<caret line="88" column="59" selection-start-line="88" selection-start-column="47" selection-end-line="88" selection-end-column="59" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/home/controller/Index.php">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/view/index/index.html">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/view/merchant_goods/add.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="17">
<caret line="1" selection-start-line="1" selection-end-line="2" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/view/merchant_goods/index.html">
<provider selected="true" editor-type-id="text-editor">
<state>
... ... @@ -889,13 +821,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/public/assets/js/backend/merchant_goods.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="2805">
<caret line="183" column="13" selection-start-line="183" selection-start-column="13" selection-end-line="183" selection-end-column="13" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/view/user_money_log/index.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="238">
... ... @@ -945,13 +870,6 @@
</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="1082">
<caret line="195" column="5" lean-forward="true" selection-start-line="145" selection-start-column="4" selection-end-line="195" selection-end-column="5" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/home/controller/Goods.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="221">
... ... @@ -969,6 +887,23 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/extra/wechat.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="833">
<caret line="49" column="65" selection-start-line="49" selection-start-column="65" selection-end-line="49" selection-end-column="65" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/controller/UserMoneyLogAudit.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="504">
<caret line="130" column="25" selection-start-line="130" selection-start-column="25" selection-end-line="130" selection-end-column="25" />
<folding>
<element signature="e#40#74#0#PHP" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/public/assets/js/backend/user_money_log.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="544">
... ... @@ -978,29 +913,153 @@
</entry>
<entry file="file://$PROJECT_DIR$/public/assets/js/backend/user_money_log_audit.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="646">
<caret line="38" column="71" selection-start-line="38" selection-start-column="71" selection-end-line="38" selection-end-column="71" />
<state relative-caret-position="459">
<caret line="27" column="70" lean-forward="true" selection-start-line="27" selection-start-column="70" selection-end-line="27" selection-end-column="70" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/view/merchant_goods/edit.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="276">
<caret line="221" column="54" lean-forward="true" selection-end-line="249" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/view/merchant_goods/add.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="340">
<caret line="20" column="57" lean-forward="true" selection-end-line="249" />
<folding>
<element signature="n#style#0;n#div#2;n#form#0;n#!!top" expanded="true" />
<element signature="n#style#0;n#div#3;n#form#0;n#!!top" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/view/goods/add.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="810">
<caret line="249" selection-start-line="249" selection-end-line="249" />
<folding>
<element signature="n#style#0;n#div#2;n#form#0;n#!!top" expanded="true" />
<element signature="n#style#0;n#div#3;n#form#0;n#!!top" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/model/MerchantGoods.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="289">
<caret line="41" column="4" selection-start-line="41" selection-start-column="4" selection-end-line="64" selection-end-column="5" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/public/assets/js/backend/merchant_goods.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="459">
<caret line="27" column="70" selection-start-line="27" selection-start-column="70" selection-end-line="27" selection-end-column="70" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/view/goods/index.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="544">
<caret line="32" selection-start-line="32" selection-end-line="32" />
</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="103">
<caret line="197" column="4" selection-start-line="197" selection-start-column="4" selection-end-line="231" selection-end-column="5" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/view/goods/edit.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="3088">
<caret line="216" column="159" selection-start-line="216" selection-start-column="159" selection-end-line="216" selection-end-column="159" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/common/controller/WechatBase.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="504">
<caret line="74" column="43" selection-start-line="74" selection-start-column="37" selection-end-line="74" selection-end-column="43" />
<state relative-caret-position="521">
<caret line="75" column="53" selection-start-line="75" selection-start-column="53" selection-end-line="75" selection-end-column="53" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/extra/wechat.php">
<entry file="file://$PROJECT_DIR$/public/assets/js/backend/users.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="833">
<caret line="49" column="65" selection-start-line="49" selection-start-column="65" selection-end-line="49" selection-end-column="65" />
<state relative-caret-position="238">
<caret line="50" column="28" selection-start-line="50" selection-start-column="28" selection-end-line="71" selection-end-column="30" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/controller/UserMoneyLogAudit.php">
<entry file="file://$PROJECT_DIR$/public/assets/js/backend/goods.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="504">
<caret line="130" column="25" lean-forward="true" selection-start-line="130" selection-start-column="25" selection-end-line="130" selection-end-column="25" />
<state relative-caret-position="-561">
<caret line="24" column="20" selection-start-line="24" selection-start-column="20" selection-end-line="146" selection-end-column="15" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/model/Goods.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="527">
<caret line="64" column="5" lean-forward="true" selection-start-line="41" selection-start-column="4" selection-end-line="64" selection-end-column="5" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/view/goods_audit/index.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="510">
<caret line="30" column="33" selection-start-line="24" selection-start-column="24" selection-end-line="30" selection-end-column="33" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/controller/Users.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-306" />
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/model/GoodsAudit.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="119">
<caret line="7" column="6" selection-start-line="7" selection-start-column="6" selection-end-line="7" selection-end-column="6" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/controller/MerchantGoods.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="-1360">
<caret line="55" column="13" selection-start-line="55" selection-start-column="13" selection-end-line="55" selection-end-column="13" />
<folding>
<element signature="e#40#74#0#PHP" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/public/assets/js/backend/goods_audit.js">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="476">
<caret line="28" column="53" selection-start-line="28" selection-start-column="39" selection-end-line="28" selection-end-column="53" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/controller/GoodsAudit.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="136">
<caret line="20" column="4" lean-forward="true" selection-start-line="20" selection-start-column="4" selection-end-line="20" selection-end-column="106" />
<folding>
<element signature="e#40#74#0#PHP" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/application/admin/controller/Goods.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="340">
<caret line="20" column="106" selection-start-line="20" selection-start-column="106" selection-end-line="20" selection-end-column="106" />
<folding>
<element signature="e#40#74#0#PHP" expanded="true" />
</folding>
... ...
<?php
namespace app\admin\controller;
use app\common\controller\Backend;
use think\Db;
/**
* 广告
*
* @icon fa fa-circle-o
*/
class Goods extends Backend
{
/**
* Goods模型对象
* @var \app\admin\model\Goods
*/
protected $model = null;
protected $searchFields = 'goods_name,admin.merchant_title,admin.merchant_name,admin.merchant_mobile';
public function _initialize()
{
parent::_initialize();
$this->model = new \app\admin\model\Goods;
$this->view->assign("typeList", $this->model->getTypeList());
$this->view->assign("sexList", $this->model->getSexList());
$this->view->assign("statusList", $this->model->getStatusList());
$this->view->assign("userIsUpList", $this->model->getUserIsUpList());
$this->view->assign("adminIsUpList", $this->model->getAdminIsUpList());
}
/**
* 默认生成的控制器所继承的父类中有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(['admin'])
->where($where)
->where(['admin_deletetime'=>0,'admin_is_up'=>1])
->order($sort, $order)
->count();
$list = $this->model
->with(['admin'])
->where($where)
->where(['admin_deletetime'=>0,'admin_is_up'=>1])
->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();
}
/**
* 添加
*/
public function add()
{
$goods_id = $this->request->param('goods_id',0,'intval');
if ($this->request->isPost()) {
$params = $this->request->post("row/a");
if ($params) {
$params = $this->preExcludeFields($params);
if ($this->dataLimit && $this->dataLimitFieldAutoFill) {
$params[$this->dataLimitField] = $this->auth->id;
}
$result = false;
Db::startTrans();
try {
//是否采用模型验证
if ($this->modelValidate) {
$name = str_replace("\\model\\", "\\validate\\", get_class($this->model));
$validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate;
$this->model->validateFailException(true)->validate($validate);
}
if($params['type'] == 1){
if(empty($params['video'])){
$this->error('请上传视频');
}
}else if($params['type'] == 2){
if(empty($params['voice'])){
$this->error('请上传音频');
}
}else if($params['type'] == 3){
if(empty($params['content'])){
$this->error('内容不能为空');
}
if(empty($params['view_time'])){
$this->error('最短观看时间不能为空');
}
}
if(empty($params['min_age'])){
$this->error('最小年龄不能为空');
}
if(empty($params['min_age'])){
$this->error('最大年龄不能为空');
}
if($params['min_age'] > $params['max_age']){
$this->error('最小年龄不能大于最大年龄');
}
if(empty($params['area']) || empty($params['longitude']) || empty($params['latitude'])){
$this->error('请选择地址');
}
if(empty($params['start_time'])){
$this->error('开始时间不能为空');
}
if(empty($params['end_time'])){
$this->error('截止时间不能为空');
}
if(empty($params['start_time'])){
$this->error('开始时间不能为空');
}
if(empty($params['url'])){
$this->error('链接地址不能为空');
}
if(empty($params['exp'])){
$this->error('答题积分不能为空');
}
if(empty($params['images'])){
$this->error('请上传明星代言');
}
if(empty($params['question'])){
$this->error('题不能为空');
}
$question = json_decode($params['question'],true);
foreach($question as $key => $q){
if(empty($q['question_type'])){
$this->error("第".($key+1)."题问题类型不能为空");
}
if(empty($q['question_name'])){
$this->error("第".($key+1)."题问题名称不能为空");
}
if(empty($q['question_answer'])){
$this->error("第".($key+1)."题正确答案不能为空");
}
if($q['question_type'] == 2){
if(empty($q['option'])){
$this->error("第".($key+1)."题正选项不能为空");
}
}
}
$params['start_time'] = strtotime($params['start_time']);
$params['end_time'] = strtotime($params['end_time']);
$params['admin_id'] = $this->auth->id;
$result = $this->model->allowField(true)->save($params);
Db::commit();
} catch (ValidateException $e) {
Db::rollback();
$this->error($e->getMessage());
} catch (PDOException $e) {
Db::rollback();
$this->error($e->getMessage());
} catch (Exception $e) {
Db::rollback();
$this->error($e->getMessage());
}
if ($result !== false) {
$this->success();
} else {
$this->error(__('No rows were inserted'));
}
}
$this->error(__('Parameter %s can not be empty', ''));
}
$this->assign('goods_id',$goods_id);
return $this->view->fetch();
}
/**
* 编辑
*/
public function edit($ids = null)
{
$row = $this->model->get($ids);
if (!$row) {
$this->error(__('No Results were found'));
}
$adminIds = $this->getDataLimitAdminIds();
if (is_array($adminIds)) {
if (!in_array($row[$this->dataLimitField], $adminIds)) {
$this->error(__('You have no permission'));
}
}
if ($this->request->isPost()) {
$params = $this->request->post("row/a");
if ($params) {
$params = $this->preExcludeFields($params);
$result = false;
Db::startTrans();
try {
//是否采用模型验证
if ($this->modelValidate) {
$name = str_replace("\\model\\", "\\validate\\", get_class($this->model));
$validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate;
$row->validateFailException(true)->validate($validate);
}
if($params['type'] == 1){
if(empty($params['video'])){
$this->error('请上传视频');
}
}else if($params['type'] == 2){
if(empty($params['voice'])){
$this->error('请上传音频');
}
}else if($params['type'] == 3){
if(empty($params['content'])){
$this->error('内容不能为空');
}
if(empty($params['view_time'])){
$this->error('最短观看时间不能为空');
}
}
if(empty($params['min_age'])){
$this->error('最小年龄不能为空');
}
if(empty($params['min_age'])){
$this->error('最大年龄不能为空');
}
if($params['min_age'] > $params['max_age']){
$this->error('最小年龄不能大于最大年龄');
}
if(empty($params['area']) || empty($params['longitude']) || empty($params['latitude'])){
$this->error('请选择地址');
}
if(empty($params['start_time'])){
$this->error('开始时间不能为空');
}
if(empty($params['end_time'])){
$this->error('截止时间不能为空');
}
if(empty($params['start_time'])){
$this->error('开始时间不能为空');
}
if(empty($params['url'])){
$this->error('链接地址不能为空');
}
if(empty($params['exp'])){
$this->error('答题积分不能为空');
}
if(empty($params['images'])){
$this->error('请上传明星代言');
}
if(empty($params['question'])){
$this->error('题不能为空');
}
$question = json_decode($params['question'],true);
foreach($question as $key => $q){
if(empty($q['question_type'])){
$this->error("第".($key+1)."题问题类型不能为空");
}
if(empty($q['question_name'])){
$this->error("第".($key+1)."题问题名称不能为空");
}
if(empty($q['question_answer'])){
$this->error("第".($key+1)."题正确答案不能为空");
}
if($q['question_type'] == 2){
if(empty($q['option'])){
$this->error("第".($key+1)."题正选项不能为空");
}
}
}
$params['start_time'] = strtotime($params['start_time']);
$params['end_time'] = strtotime($params['end_time']);
$result = $row->allowField(true)->save($params);
Db::commit();
} catch (ValidateException $e) {
Db::rollback();
$this->error($e->getMessage());
} catch (PDOException $e) {
Db::rollback();
$this->error($e->getMessage());
} catch (Exception $e) {
Db::rollback();
$this->error($e->getMessage());
}
if ($result !== false) {
$this->success();
} else {
$this->error(__('No rows were updated'));
}
}
$this->error(__('Parameter %s can not be empty', ''));
}
$this->view->assign("row", $row);
return $this->view->fetch();
}
/**
* 删除
*/
public function del($ids = "")
{
if ($ids) {
$pk = $this->model->getPk();
$adminIds = $this->getDataLimitAdminIds();
if (is_array($adminIds)) {
$this->model->where($this->dataLimitField, 'in', $adminIds);
}
$list = $this->model->where($pk, 'in', $ids)->select();
$count = 0;
Db::startTrans();
try {
foreach ($list as $k => $v) {
$count += $v->where(['id'=>$v['id']])->update(['admin_deletetime'=>time()]);
}
Db::commit();
} catch (PDOException $e) {
Db::rollback();
$this->error($e->getMessage());
} catch (Exception $e) {
Db::rollback();
$this->error($e->getMessage());
}
if ($count) {
$this->success();
} else {
$this->error(__('No rows were deleted'));
}
}
$this->error(__('Parameter %s can not be empty', 'ids'));
}
/**
* 更改状态
* @param string $ids
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public function status($ids = ""){
if ($ids) {
$status = $this->request->param('status',0,'intval');
$pk = $this->model->getPk();
$adminIds = $this->getDataLimitAdminIds();
if (is_array($adminIds)) {
$this->model->where($this->dataLimitField, 'in', $adminIds);
}
$list = $this->model->where($pk, 'in', $ids)->select();
$count = 0;
Db::startTrans();
try {
foreach ($list as $k => $v) {
$count += $v->where(['id'=>$v['id']])->update(['status'=>$status]);
}
Db::commit();
} catch (PDOException $e) {
Db::rollback();
$this->error($e->getMessage());
} catch (Exception $e) {
Db::rollback();
$this->error($e->getMessage());
}
if ($count) {
$this->success();
} else {
$this->error(__('No rows were deleted'));
}
}
$this->error(__('Parameter %s can not be empty', 'ids'));
}
}
... ...
<?php
namespace app\admin\controller;
use app\common\controller\Backend;
use think\Db;
/**
* 广告
*
* @icon fa fa-circle-o
*/
class GoodsAudit extends Backend
{
/**
* GoodsAudit模型对象
* @var \app\admin\model\GoodsAudit
*/
protected $model = null;
protected $searchFields = 'goods_name,admin.merchant_title,admin.merchant_name,admin.merchant_mobile';
public function _initialize()
{
parent::_initialize();
$this->model = new \app\admin\model\GoodsAudit;
$this->view->assign("typeList", $this->model->getTypeList());
$this->view->assign("sexList", $this->model->getSexList());
$this->view->assign("statusList", $this->model->getStatusList());
$this->view->assign("userIsUpList", $this->model->getUserIsUpList());
$this->view->assign("adminIsUpList", $this->model->getAdminIsUpList());
}
/**
* 默认生成的控制器所继承的父类中有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(['admin'])
->where($where)
->where(['goods_audit.status'=>'1','admin_deletetime'=>0,'admin_is_up'=>1,'user_deletetime'=>0])
->order($sort, $order)
->count();
$list = $this->model
->with(['admin'])
->where($where)
->where(['goods_audit.status'=>'1','admin_deletetime'=>0,'admin_is_up'=>1,'user_deletetime'=>0])
->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();
}
/**
* 添加
*/
public function add()
{
$goods_id = $this->request->param('goods_id',0,'intval');
if ($this->request->isPost()) {
$params = $this->request->post("row/a");
if ($params) {
$params = $this->preExcludeFields($params);
if ($this->dataLimit && $this->dataLimitFieldAutoFill) {
$params[$this->dataLimitField] = $this->auth->id;
}
$result = false;
Db::startTrans();
try {
//是否采用模型验证
if ($this->modelValidate) {
$name = str_replace("\\model\\", "\\validate\\", get_class($this->model));
$validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.add' : $name) : $this->modelValidate;
$this->model->validateFailException(true)->validate($validate);
}
if($params['type'] == 1){
if(empty($params['video'])){
$this->error('请上传视频');
}
}else if($params['type'] == 2){
if(empty($params['voice'])){
$this->error('请上传音频');
}
}else if($params['type'] == 3){
if(empty($params['content'])){
$this->error('内容不能为空');
}
if(empty($params['view_time'])){
$this->error('最短观看时间不能为空');
}
}
if(empty($params['min_age'])){
$this->error('最小年龄不能为空');
}
if(empty($params['min_age'])){
$this->error('最大年龄不能为空');
}
if($params['min_age'] > $params['max_age']){
$this->error('最小年龄不能大于最大年龄');
}
if(empty($params['area']) || empty($params['longitude']) || empty($params['latitude'])){
$this->error('请选择地址');
}
if(empty($params['start_time'])){
$this->error('开始时间不能为空');
}
if(empty($params['end_time'])){
$this->error('截止时间不能为空');
}
if(empty($params['start_time'])){
$this->error('开始时间不能为空');
}
if(empty($params['url'])){
$this->error('链接地址不能为空');
}
if(empty($params['exp'])){
$this->error('答题积分不能为空');
}
if(empty($params['images'])){
$this->error('请上传明星代言');
}
if(empty($params['question'])){
$this->error('题不能为空');
}
$question = json_decode($params['question'],true);
foreach($question as $key => $q){
if(empty($q['question_type'])){
$this->error("第".($key+1)."题问题类型不能为空");
}
if(empty($q['question_name'])){
$this->error("第".($key+1)."题问题名称不能为空");
}
if(empty($q['question_answer'])){
$this->error("第".($key+1)."题正确答案不能为空");
}
if($q['question_type'] == 2){
if(empty($q['option'])){
$this->error("第".($key+1)."题正选项不能为空");
}
}
}
$params['start_time'] = strtotime($params['start_time']);
$params['end_time'] = strtotime($params['end_time']);
$params['admin_id'] = $this->auth->id;
$result = $this->model->allowField(true)->save($params);
Db::commit();
} catch (ValidateException $e) {
Db::rollback();
$this->error($e->getMessage());
} catch (PDOException $e) {
Db::rollback();
$this->error($e->getMessage());
} catch (Exception $e) {
Db::rollback();
$this->error($e->getMessage());
}
if ($result !== false) {
$this->success();
} else {
$this->error(__('No rows were inserted'));
}
}
$this->error(__('Parameter %s can not be empty', ''));
}
$this->assign('goods_id',$goods_id);
return $this->view->fetch();
}
/**
* 编辑
*/
public function edit($ids = null)
{
$row = $this->model->get($ids);
if (!$row) {
$this->error(__('No Results were found'));
}
$adminIds = $this->getDataLimitAdminIds();
if (is_array($adminIds)) {
if (!in_array($row[$this->dataLimitField], $adminIds)) {
$this->error(__('You have no permission'));
}
}
if ($this->request->isPost()) {
$params = $this->request->post("row/a");
if ($params) {
$params = $this->preExcludeFields($params);
$result = false;
Db::startTrans();
try {
//是否采用模型验证
if ($this->modelValidate) {
$name = str_replace("\\model\\", "\\validate\\", get_class($this->model));
$validate = is_bool($this->modelValidate) ? ($this->modelSceneValidate ? $name . '.edit' : $name) : $this->modelValidate;
$row->validateFailException(true)->validate($validate);
}
if($params['type'] == 1){
if(empty($params['video'])){
$this->error('请上传视频');
}
}else if($params['type'] == 2){
if(empty($params['voice'])){
$this->error('请上传音频');
}
}else if($params['type'] == 3){
if(empty($params['content'])){
$this->error('内容不能为空');
}
if(empty($params['view_time'])){
$this->error('最短观看时间不能为空');
}
}
if(empty($params['min_age'])){
$this->error('最小年龄不能为空');
}
if(empty($params['min_age'])){
$this->error('最大年龄不能为空');
}
if($params['min_age'] > $params['max_age']){
$this->error('最小年龄不能大于最大年龄');
}
if(empty($params['area']) || empty($params['longitude']) || empty($params['latitude'])){
$this->error('请选择地址');
}
if(empty($params['start_time'])){
$this->error('开始时间不能为空');
}
if(empty($params['end_time'])){
$this->error('截止时间不能为空');
}
if(empty($params['start_time'])){
$this->error('开始时间不能为空');
}
if(empty($params['url'])){
$this->error('链接地址不能为空');
}
if(empty($params['exp'])){
$this->error('答题积分不能为空');
}
if(empty($params['images'])){
$this->error('请上传明星代言');
}
if(empty($params['question'])){
$this->error('题不能为空');
}
$question = json_decode($params['question'],true);
foreach($question as $key => $q){
if(empty($q['question_type'])){
$this->error("第".($key+1)."题问题类型不能为空");
}
if(empty($q['question_name'])){
$this->error("第".($key+1)."题问题名称不能为空");
}
if(empty($q['question_answer'])){
$this->error("第".($key+1)."题正确答案不能为空");
}
if($q['question_type'] == 2){
if(empty($q['option'])){
$this->error("第".($key+1)."题正选项不能为空");
}
}
}
$params['start_time'] = strtotime($params['start_time']);
$params['end_time'] = strtotime($params['end_time']);
$result = $row->allowField(true)->save($params);
Db::commit();
} catch (ValidateException $e) {
Db::rollback();
$this->error($e->getMessage());
} catch (PDOException $e) {
Db::rollback();
$this->error($e->getMessage());
} catch (Exception $e) {
Db::rollback();
$this->error($e->getMessage());
}
if ($result !== false) {
$this->success();
} else {
$this->error(__('No rows were updated'));
}
}
$this->error(__('Parameter %s can not be empty', ''));
}
$this->view->assign("row", $row);
return $this->view->fetch();
}
/**
* 删除
*/
public function del($ids = "")
{
if ($ids) {
$pk = $this->model->getPk();
$adminIds = $this->getDataLimitAdminIds();
if (is_array($adminIds)) {
$this->model->where($this->dataLimitField, 'in', $adminIds);
}
$list = $this->model->where($pk, 'in', $ids)->select();
$count = 0;
Db::startTrans();
try {
foreach ($list as $k => $v) {
$count += $v->where(['id'=>$v['id']])->update(['user_deletetime'=>time()]);
}
Db::commit();
} catch (PDOException $e) {
Db::rollback();
$this->error($e->getMessage());
} catch (Exception $e) {
Db::rollback();
$this->error($e->getMessage());
}
if ($count) {
$this->success();
} else {
$this->error(__('No rows were deleted'));
}
}
$this->error(__('Parameter %s can not be empty', 'ids'));
}
}
... ...
... ... @@ -318,4 +318,40 @@ class MerchantGoods extends Backend
$this->view->assign("row", $row);
return $this->view->fetch();
}
/**
* 删除
*/
public function del($ids = "")
{
if ($ids) {
$pk = $this->model->getPk();
$adminIds = $this->getDataLimitAdminIds();
if (is_array($adminIds)) {
$this->model->where($this->dataLimitField, 'in', $adminIds);
}
$list = $this->model->where($pk, 'in', $ids)->select();
$count = 0;
Db::startTrans();
try {
foreach ($list as $k => $v) {
$count += $v->where(['id'=>$v['id']])->update(['user_deletetime'=>time()]);
}
Db::commit();
} catch (PDOException $e) {
Db::rollback();
$this->error($e->getMessage());
} catch (Exception $e) {
Db::rollback();
$this->error($e->getMessage());
}
if ($count) {
$this->success();
} else {
$this->error(__('No rows were deleted'));
}
}
$this->error(__('Parameter %s can not be empty', 'ids'));
}
}
... ...
<?php
return [
'Admin_id' => '商户id',
'Goods_name' => '广告名称',
'Type' => '广告类型:1=视频,2=音频,3图文',
'Video' => '视频地址',
'Voice' => '音频地址',
'Content' => '内容',
'View_time' => '最短观看时间,单位:分钟(图文类型使用,其他类型使用视频或者音频时间长度)',
'Start_time' => '开始时间',
'End_time' => '截止时间',
'Sex' => '限制用户性别:0=不限,1男,2女',
'Min_age' => '最小年龄',
'Max_age' => '最大年龄',
'Province' => '省',
'City' => '城市',
'County' => '区/县',
'Address' => '详细地址',
'Longitude' => '经度',
'Latitude' => '纬度',
'Distance' => '距离',
'Url' => '链接地址',
'Status' => '状态:1=待审核,2=审核通过,3审核未通过',
'Exp' => '答题积分',
'View' => '浏览量',
'Images' => '明星代言',
'User_is_up' => '商户端是否上架',
'Admin_is_up' => '管理员端是否上架',
'User_deletetime' => '商户端是否删除',
'Admin_deletetime' => '管理员端是否删除',
'Createtime' => '创建时间',
'Updatetime' => '更新时间',
'Question' => '问题',
'Area' => '地址',
'Admin.id' => 'ID',
'Admin.username' => '用户名',
'Admin.nickname' => '昵称',
'Admin.password' => '密码',
'Admin.salt' => '密码盐',
'Admin.avatar' => '头像',
'Admin.email' => '电子邮箱',
'Admin.loginfailure' => '失败次数',
'Admin.logintime' => '登录时间',
'Admin.createtime' => '创建时间',
'Admin.updatetime' => '更新时间',
'Admin.token' => 'Session标识',
'Admin.status' => '状态',
'Admin.user_id' => '绑定user_id',
'Admin.money' => '余额',
'Admin.merchant_title' => '商家名称',
'Admin.merchant_name' => '商家联系人姓名',
'Admin.merchant_mobile' => '商家联系人电话',
'Admin.area' => '地址',
'Admin.brief' => '简介',
'Admin.business_images' => '营业执照',
'Admin.other_images' => '其他图片'
];
... ...
<?php
return [
'Admin_id' => '商户id',
'Goods_name' => '广告名称',
'Type' => '广告类型:1=视频,2=音频,3图文',
'Video' => '视频地址',
'Voice' => '音频地址',
'Content' => '内容',
'View_time' => '最短观看时间,单位:分钟(图文类型使用,其他类型使用视频或者音频时间长度)',
'Start_time' => '开始时间',
'End_time' => '截止时间',
'Sex' => '限制用户性别:0=不限,1男,2女',
'Min_age' => '最小年龄',
'Max_age' => '最大年龄',
'Province' => '省',
'City' => '城市',
'County' => '区/县',
'Address' => '详细地址',
'Longitude' => '经度',
'Latitude' => '纬度',
'Distance' => '距离',
'Url' => '链接地址',
'Status' => '状态:1=待审核,2=审核通过,3审核未通过',
'Exp' => '答题积分',
'View' => '浏览量',
'Images' => '明星代言',
'User_is_up' => '商户端是否上架',
'Admin_is_up' => '管理员端是否上架',
'User_deletetime' => '商户端是否删除',
'Admin_deletetime' => '管理员端是否删除',
'Createtime' => '创建时间',
'Updatetime' => '更新时间',
'Question' => '问题',
'Area' => '地址',
'Admin.id' => 'ID',
'Admin.username' => '用户名',
'Admin.nickname' => '昵称',
'Admin.password' => '密码',
'Admin.salt' => '密码盐',
'Admin.avatar' => '头像',
'Admin.email' => '电子邮箱',
'Admin.loginfailure' => '失败次数',
'Admin.logintime' => '登录时间',
'Admin.createtime' => '创建时间',
'Admin.updatetime' => '更新时间',
'Admin.token' => 'Session标识',
'Admin.status' => '状态',
'Admin.user_id' => '绑定user_id',
'Admin.money' => '余额',
'Admin.merchant_title' => '商家名称',
'Admin.merchant_name' => '商家联系人姓名',
'Admin.merchant_mobile' => '商家联系人电话',
'Admin.area' => '地址',
'Admin.brief' => '简介',
'Admin.business_images' => '营业执照',
'Admin.other_images' => '其他图片'
];
... ...
<?php
namespace app\admin\model;
use think\Model;
class Goods extends Model
{
// 表名
protected $name = 'goods';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'int';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected $deleteTime = false;
// 追加属性
protected $append = [
'type_text',
// 'view_time_text',
'start_time_text',
'end_time_text',
'sex_text',
'status_text',
'user_is_up_text',
'admin_is_up_text',
'user_deletetime_text',
'admin_deletetime_text'
];
public function getTypeList()
{
return ['3' => __('图文'), '2' => __('音频'), '1' => __('视频')];
}
public function getSexList()
{
return ['2' => __('女'), '1' => __('男'), '0' => __('不限')];
}
public function getStatusList()
{
return ['3' => __('审核失败'), '2' => __('审核通过'), '1' => __('审核中')];
}
public function getUserIsUpList()
{
return ['1' => __('上架'), '0' => __('下架')];
}
public function getAdminIsUpList()
{
return ['1' => __('上架'), '0' => __('下架')];
}
public function getTypeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['type']) ? $data['type'] : '');
$list = $this->getTypeList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getViewTimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['view_time']) ? $data['view_time'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getStartTimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['start_time']) ? $data['start_time'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getEndTimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['end_time']) ? $data['end_time'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getSexTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['sex']) ? $data['sex'] : '');
$list = $this->getSexList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getStatusTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
$list = $this->getStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getUserIsUpTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['user_is_up']) ? $data['user_is_up'] : '');
$list = $this->getUserIsUpList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getAdminIsUpTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['admin_is_up']) ? $data['admin_is_up'] : '');
$list = $this->getAdminIsUpList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getUserDeletetimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['user_deletetime']) ? $data['user_deletetime'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getAdminDeletetimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['admin_deletetime']) ? $data['admin_deletetime'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
protected function setViewTimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setStartTimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setEndTimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setUserDeletetimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setAdminDeletetimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
public function admin()
{
return $this->belongsTo('Admin', 'admin_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
}
... ...
<?php
namespace app\admin\model;
use think\Model;
class GoodsAudit extends Model
{
// 表名
protected $name = 'goods';
// 自动写入时间戳字段
protected $autoWriteTimestamp = 'int';
// 定义时间戳字段名
protected $createTime = 'createtime';
protected $updateTime = 'updatetime';
protected $deleteTime = false;
// 追加属性
protected $append = [
'type_text',
// 'view_time_text',
'start_time_text',
'end_time_text',
'sex_text',
'status_text',
'user_is_up_text',
'admin_is_up_text',
'user_deletetime_text',
'admin_deletetime_text'
];
public function getTypeList()
{
return ['3' => __('图文'), '2' => __('音频'), '1' => __('视频')];
}
public function getSexList()
{
return ['2' => __('女'), '1' => __('男'), '0' => __('不限')];
}
public function getStatusList()
{
return ['3' => __('审核失败'), '2' => __('审核通过'), '1' => __('审核中')];
}
public function getUserIsUpList()
{
return ['1' => __('上架'), '0' => __('下架')];
}
public function getAdminIsUpList()
{
return ['1' => __('上架'), '0' => __('下架')];
}
public function getTypeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['type']) ? $data['type'] : '');
$list = $this->getTypeList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getViewTimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['view_time']) ? $data['view_time'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getStartTimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['start_time']) ? $data['start_time'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getEndTimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['end_time']) ? $data['end_time'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getSexTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['sex']) ? $data['sex'] : '');
$list = $this->getSexList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getStatusTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['status']) ? $data['status'] : '');
$list = $this->getStatusList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getUserIsUpTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['user_is_up']) ? $data['user_is_up'] : '');
$list = $this->getUserIsUpList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getAdminIsUpTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['admin_is_up']) ? $data['admin_is_up'] : '');
$list = $this->getAdminIsUpList();
return isset($list[$value]) ? $list[$value] : '';
}
public function getUserDeletetimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['user_deletetime']) ? $data['user_deletetime'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
public function getAdminDeletetimeTextAttr($value, $data)
{
$value = $value ? $value : (isset($data['admin_deletetime']) ? $data['admin_deletetime'] : '');
return is_numeric($value) ? date("Y-m-d H:i:s", $value) : $value;
}
protected function setViewTimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setStartTimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setEndTimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setUserDeletetimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
protected function setAdminDeletetimeAttr($value)
{
return $value === '' ? null : ($value && !is_numeric($value) ? strtotime($value) : $value);
}
public function admin()
{
return $this->belongsTo('Admin', 'admin_id', 'id', [], 'LEFT')->setEagerlyType(0);
}
}
... ...
<?php
namespace app\admin\validate;
use think\Validate;
class Goods extends Validate
{
/**
* 验证规则
*/
protected $rule = [
];
/**
* 提示消息
*/
protected $message = [
];
/**
* 验证场景
*/
protected $scene = [
'add' => [],
'edit' => [],
];
}
... ...
<?php
namespace app\admin\validate;
use think\Validate;
class GoodsAudit 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">{:__('广告类型')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="typeList" item="vo"}
<label class="type" for="row[type]-{$key}"><input class="type" id="row[type]-{$key}" name="row[type]" type="radio" value="{$key}" {in name="key" value="3"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Goods_name')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-goods_name" data-rule="required" class="form-control" name="row[goods_name]" type="text">
</div>
</div>
<div class="form-group video" style="display: none;">
<label class="control-label col-xs-12 col-sm-2">{:__('Video')}:</label>
<div class="col-xs-12 col-sm-8">
<!--<input id="c-video" class="form-control" name="row[video]" type="text">-->
<div class="input-group">
<input id="c-video" class="form-control" size="50" name="row[video]" type="text">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="plupload-video" class="btn btn-danger plupload" data-input-id="c-video" data-mimetype="mp4,avi,flv,wmv" data-multiple="true" data-preview-id="p-video"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-video" class="btn btn-primary fachoose" data-input-id="c-video" data-mimetype="mp4,avi,flv,wmv" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
<span class="msg-box n-right" for="c-video"></span>
</div>
<ul class="row list-inline plupload-preview" id="p-video"></ul>
<!--<div class="input-group">
<input id="c-video" class="form-control" size="50" name="row[video]" type="text">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="plupload-video" class="btn btn-danger plupload" data-input-id="c-video" data-mimetype="mp4,avi,flv,wmv" data-multiple="false" data-preview-id="p-video"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-video" class="btn btn-primary fachoose" data-input-id="c-video" data-mimetype="mp4,avi,flv,wmv" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
<span class="msg-box n-right" for="c-video"></span>
</div>
<ul class="row list-inline plupload-preview" id="p-video"></ul>-->
</div>
</div>
<div class="form-group voice" style="display: none;">
<label class="control-label col-xs-12 col-sm-2">{:__('Voice')}:</label>
<div class="col-xs-12 col-sm-8">
<!--<input id="c-voice" class="form-control" name="row[voice]" type="text">-->
<div class="input-group">
<input id="c-voice" class="form-control" size="50" name="row[voice]" type="text">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="plupload-voice" class="btn btn-danger plupload" data-input-id="c-voice" data-mimetype="mp3" data-multiple="true" data-preview-id="p-voice"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-voice" class="btn btn-primary fachoose" data-input-id="c-voice" data-mimetype="mp3" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
<span class="msg-box n-right" for="c-voice"></span>
</div>
<ul class="row list-inline plupload-preview" id="p-voice"></ul>
</div>
</div>
<div class="form-group content2">
<label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
<div class="col-xs-12 col-sm-8">
<textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50"></textarea>
</div>
</div>
<div class="form-group view_time">
<label class="control-label col-xs-12 col-sm-2">{:__('最短观看时间')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-view_time" class="form-control" name="row[view_time]" type="number" value="0">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('限制性别')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="sexList" item="vo"}
<label for="row[sex]-{$key}"><input id="row[sex]-{$key}" name="row[sex]" type="radio" value="{$key}" {in name="key" value="0"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Min_age')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-min_age" class="form-control" name="row[min_age]" type="number">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Max_age')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-max_age" class="form-control" name="row[max_age]" type="number">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('地址')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-area" data-toggle="addresspicker" data-input-id="c-area" data-lat-id="c-latitude" data-lng-id="c-longitude" class="form-control" name="row[area]" type="text" readonly="true">
</div>
</div>
<!--<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Province')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-province" data-rule="required" class="form-control" name="row[province]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('City')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-city" data-rule="required" class="form-control" name="row[city]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('County')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-county" data-rule="required" class="form-control" name="row[county]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Address')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-address" data-rule="required" class="form-control" name="row[address]" type="text">
</div>
</div>-->
<div class="form-group hidden" readonly="true">
<label class="control-label col-xs-12 col-sm-2">{:__('Longitude')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-longitude" class="form-control" name="row[longitude]" type="text">
</div>
</div>
<div class="form-group hidden" readonly="true">
<label class="control-label col-xs-12 col-sm-2">{:__('Latitude')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-latitude" class="form-control" name="row[latitude]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Distance')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-distance" class="form-control" name="row[distance]" type="number" value="0">
<p class="text-warning">0为不限</p>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Start_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-start_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[start_time]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('End_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-end_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[end_time]" type="text" value="">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Url')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-url" class="form-control" name="row[url]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Exp')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-exp" class="form-control" name="row[exp]" type="number">
</div>
</div>
<!--<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('View')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-view" class="form-control" name="row[view]" type="number" value="0">
</div>
</div>-->
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Images')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-images" class="form-control" size="50" name="row[images]" type="text">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="plupload-images" class="btn btn-danger plupload" data-input-id="c-images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="true" data-preview-id="p-images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-images" class="btn btn-primary fachoose" data-input-id="c-images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
<span class="msg-box n-right" for="c-images"></span>
</div>
<ul class="row list-inline plupload-preview" id="p-images"></ul>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('上架状态')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="userIsUpList" item="vo"}
<label for="row[user_is_up]-{$key}"><input id="row[user_is_up]-{$key}" name="row[user_is_up]" type="radio" value="{$key}" {in name="key" value="1"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>
<!--<a href="" title="添加" class="dialogit">添加</a>-->
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('题')}:</label>
<div class="col-xs-12 col-sm-8">
<!--<a href="" title="添加" class="dialogit btn btn-success btn-embossed">添加</a>-->
<!--<div id="toolbar" class="toolbar">
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('question/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
</div>
<table id="table" class="table table-striped table-bordered table-hover table-nowrap">
</table>-->
<dl class="fieldlist" data-template="questiontpl" data-name="row[question]">
<dd>
<ins>{:__('问题类型')}</ins>
<ins>{:__('问题')}</ins>
<ins>{:__('正确答案')}</ins>
<ins>{:__('选项')}<span class="text-warning">多个选项使用英文格式逗号隔开</span></ins>
</dd>
<dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
<!--请注意 dd和textarea间不能存在其它任何元素,实际开发中textarea应该添加个hidden进行隐藏-->
<textarea name="row[question]" class="form-control" cols="30" rows="5">[{"question_type":"","question_name":"","question_answer":"","option":""}]</textarea>
</dl>
<script id="questiontpl" type="text/html">
<dd class="form-inline">
<ins>
<select class="form-control" name="<%=name%>[<%=index%>][question_type]" style="width: 100%">
<option value="">请选择</option>
<option value="2">选择题</option>
<option value="1">填空题</option>
</select>
</ins>
<ins><input type="text" name="<%=name%>[<%=index%>][question_name]" class="form-control" value="" placeholder="问题"/></ins>
<ins><input type="text" name="<%=name%>[<%=index%>][question_answer]" class="form-control" value="" placeholder="正确答案"/></ins>
<ins><input type="text" name="<%=name%>[<%=index%>][option]" class="form-control" value="" placeholder="选项"/></ins>
<!--下面的两个按钮务必保留-->
<span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
<!--<span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>-->
</dd>
</script>
</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">{:__('广告类型')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="typeList" item="vo"}
<label class="type" for="row[type]-{$key}"><input class="type" id="row[type]-{$key}" name="row[type]" type="radio" value="{$key}" {in name="key" value="$row['type']"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Goods_name')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-goods_name" data-rule="required" class="form-control" name="row[goods_name]" type="text" value="{$row.goods_name}">
</div>
</div>
<div class="form-group video" style="display: none;">
<label class="control-label col-xs-12 col-sm-2">{:__('Video')}:</label>
<div class="col-xs-12 col-sm-8">
<!--<input id="c-video" class="form-control" name="row[video]" type="text">-->
<div class="input-group">
<input id="c-video" class="form-control" size="50" name="row[video]" type="text" value="{$row.video}">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="plupload-video" class="btn btn-danger plupload" data-input-id="c-video" data-mimetype="mp4,avi,flv,wmv" data-multiple="true" data-preview-id="p-video"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-video" class="btn btn-primary fachoose" data-input-id="c-video" data-mimetype="mp4,avi,flv,wmv" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
<span class="msg-box n-right" for="c-video"></span>
</div>
<ul class="row list-inline plupload-preview" id="p-video"></ul>
<!--<div class="input-group">
<input id="c-video" class="form-control" size="50" name="row[video]" type="text">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="plupload-video" class="btn btn-danger plupload" data-input-id="c-video" data-mimetype="mp4,avi,flv,wmv" data-multiple="false" data-preview-id="p-video"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-video" class="btn btn-primary fachoose" data-input-id="c-video" data-mimetype="mp4,avi,flv,wmv" data-multiple="false"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
<span class="msg-box n-right" for="c-video"></span>
</div>
<ul class="row list-inline plupload-preview" id="p-video"></ul>-->
</div>
</div>
<div class="form-group voice" style="display: none;">
<label class="control-label col-xs-12 col-sm-2">{:__('Voice')}:</label>
<div class="col-xs-12 col-sm-8">
<!--<input id="c-voice" class="form-control" name="row[voice]" type="text">-->
<div class="input-group">
<input id="c-voice" class="form-control" size="50" name="row[voice]" type="text" value="{$row.voice}">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="plupload-voice" class="btn btn-danger plupload" data-input-id="c-voice" data-mimetype="mp3" data-multiple="true" data-preview-id="p-voice"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-voice" class="btn btn-primary fachoose" data-input-id="c-voice" data-mimetype="mp3" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
<span class="msg-box n-right" for="c-voice"></span>
</div>
<ul class="row list-inline plupload-preview" id="p-voice"></ul>
</div>
</div>
<div class="form-group content2">
<label class="control-label col-xs-12 col-sm-2">{:__('Content')}:</label>
<div class="col-xs-12 col-sm-8">
<textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50">{$row.content}</textarea>
</div>
</div>
<div class="form-group view_time">
<label class="control-label col-xs-12 col-sm-2">{:__('最短观看时间')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-view_time" class="form-control" name="row[view_time]" type="number" value="{$row.view_time}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('限制性别')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="sexList" item="vo"}
<label for="row[sex]-{$key}"><input id="row[sex]-{$key}" name="row[sex]" type="radio" value="{$key}" {in name="key" value="$row['sex']"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Min_age')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-min_age" class="form-control" name="row[min_age]" type="number" value="{$row.min_age}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Max_age')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-max_age" class="form-control" name="row[max_age]" type="number" value="{$row.max_age}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('地址')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-area" data-toggle="addresspicker" data-input-id="c-area" data-lat-id="c-latitude" data-lng-id="c-longitude" class="form-control" name="row[area]" value="{$row.area}" type="text" readonly="true">
</div>
</div>
<!--<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Province')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-province" data-rule="required" class="form-control" name="row[province]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('City')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-city" data-rule="required" class="form-control" name="row[city]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('County')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-county" data-rule="required" class="form-control" name="row[county]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Address')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-address" data-rule="required" class="form-control" name="row[address]" type="text">
</div>
</div>-->
<div class="form-group hidden" readonly="true">
<label class="control-label col-xs-12 col-sm-2">{:__('Longitude')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-longitude" class="form-control" name="row[longitude]" type="text" value="{$row.longitude}">
</div>
</div>
<div class="form-group hidden" readonly="true">
<label class="control-label col-xs-12 col-sm-2">{:__('Latitude')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-latitude" class="form-control" name="row[latitude]" type="text" value="{$row.latitude}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Distance')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-distance" class="form-control" name="row[distance]" type="number" value="{$row.distance}">
<p class="text-warning">0为不限</p>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Start_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-start_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[start_time]" type="text" value="{:date('Y-m-d',$row['start_time'])}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('End_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-end_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD" data-use-current="true" name="row[end_time]" type="text" value="{:date('Y-m-d',$row['end_time'])}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Url')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-url" class="form-control" name="row[url]" type="text" value="{$row.url}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Exp')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-exp" class="form-control" name="row[exp]" type="number" value="{$row.exp}">
</div>
</div>
<!--<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('View')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-view" class="form-control" name="row[view]" type="number" value="0">
</div>
</div>-->
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Images')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-images" class="form-control" size="50" name="row[images]" type="text" value="{$row.images}">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="plupload-images" class="btn btn-danger plupload" data-input-id="c-images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="true" data-preview-id="p-images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-images" class="btn btn-primary fachoose" data-input-id="c-images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
<span class="msg-box n-right" for="c-images"></span>
</div>
<ul class="row list-inline plupload-preview" id="p-images"></ul>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('商户端上架状态')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="userIsUpList" item="vo"}
<label for="row[user_is_up]-{$key}"><input id="row[user_is_up]-{$key}" name="row[user_is_up]" type="radio" value="{$key}" {in name="key" value="$row.user_is_up"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('管理端上架状态')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="adminIsUpList" item="vo"}
<label for="row[admin_is_up]-{$key}"><input id="row[admin_is_up]-{$key}" name="row[admin_is_up]" type="radio" value="{$key}" {in name="key" value="$row.admin_is_up"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('审核状态')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="statusList" item="vo"}
<label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>
<!--<a href="" title="添加" class="dialogit">添加</a>-->
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('题')}:</label>
<div class="col-xs-12 col-sm-8">
<!--<a href="" title="添加" class="dialogit btn btn-success btn-embossed">添加</a>-->
<!--<div id="toolbar" class="toolbar">
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('question/add')?'':'hide'}" title="{:__('Add')}" ><i class="fa fa-plus"></i> {:__('Add')}</a>
</div>
<table id="table" class="table table-striped table-bordered table-hover table-nowrap">
</table>-->
<dl class="fieldlist" data-template="questiontpl" data-name="row[question]">
<dd>
<ins>{:__('问题类型')}</ins>
<ins>{:__('问题')}</ins>
<ins>{:__('正确答案')}</ins>
<ins>{:__('选项')}<span class="text-warning">多个选项使用英文格式逗号隔开</span></ins>
</dd>
<dd><a href="javascript:;" class="btn btn-sm btn-success btn-append"><i class="fa fa-plus"></i> {:__('Append')}</a></dd>
<!--请注意 dd和textarea间不能存在其它任何元素,实际开发中textarea应该添加个hidden进行隐藏-->
<textarea name="row[question]" class="form-control" cols="30" rows="5">{$row.question}</textarea>
</dl>
<script id="questiontpl" type="text/html">
<dd class="form-inline">
<ins>
<select class="form-control" data-live-search="true" name="<%=name%>[<%=index%>][question_type]" style="width: 100%">
<option value="" >请选择</option>
<option value="2" <%if(row.question_type==2){%>selected<%}%> >选择题</option>
<option value="1" <%if(row.question_type==1){%>selected<%}%> >填空题</option>
</select>
</ins>
<ins><input type="text" name="<%=name%>[<%=index%>][question_name]" class="form-control" value="<%=row.question_name%>" placeholder="问题"/></ins>
<ins><input type="text" name="<%=name%>[<%=index%>][question_answer]" class="form-control" value="<%=row.question_answer%>" placeholder="正确答案"/></ins>
<ins><input type="text" name="<%=name%>[<%=index%>][option]" class="form-control" value="<%=row.option%>" placeholder="选项"/></ins>
<!--下面的两个按钮务必保留-->
<span class="btn btn-sm btn-danger btn-remove"><i class="fa fa-times"></i></span>
<!--<span class="btn btn-sm btn-primary btn-dragsort"><i class="fa fa-arrows"></i></span>-->
</dd>
</script>
</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>
<!--<input type="hidden" name="ids" value="{$row.id}"/>-->
<button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
</div>
</div>
</form>
... ...
<div class="panel panel-default panel-intro">
<!--<div class="panel-heading">
{:build_heading(null,FALSE)}
<ul class="nav nav-tabs" data-field="status">
<li class="active"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>
{foreach name="statusList" item="vo"}
<li><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>
{/foreach}
</ul>
</div>-->
<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('goods/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('goods/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('goods/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>
<!--<a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('goods/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('goods/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('goods/edit')}"
data-operate-del="{:$auth->check('goods/del')}"
width="100%">
</table>
</div>
</div>
</div>
</div>
</div>
... ...
<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">{:__('Goods_name')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-goods_name" data-rule="required" class="form-control" name="row[goods_name]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]">
{foreach name="typeList" item="vo"}
<option value="{$key}" {in name="key" value=""}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Video')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-video" class="form-control" name="row[video]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Voice')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-voice" class="form-control" name="row[voice]" 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">
<textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50"></textarea>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('View_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-view_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[view_time]" type="text" value="{:date('Y-m-d H:i:s')}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Start_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-start_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[start_time]" type="text" value="{:date('Y-m-d H:i:s')}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('End_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-end_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[end_time]" type="text" value="{:date('Y-m-d H:i:s')}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Sex')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-sex" class="form-control selectpicker" name="row[sex]">
{foreach name="sexList" item="vo"}
<option value="{$key}" {in name="key" value="0"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Min_age')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-min_age" class="form-control" name="row[min_age]" type="number">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Max_age')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-max_age" class="form-control" name="row[max_age]" type="number">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Province')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-province" data-rule="required" class="form-control" name="row[province]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('City')}:</label>
<div class="col-xs-12 col-sm-8">
<div class='control-relative'><input id="c-city" data-rule="required" class="form-control" data-toggle="city-picker" name="row[city]" type="text"></div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('County')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-county" data-rule="required" class="form-control" name="row[county]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Address')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-address" data-rule="required" class="form-control" name="row[address]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Longitude')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-longitude" data-rule="required" class="form-control" name="row[longitude]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Latitude')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-latitude" data-rule="required" class="form-control" name="row[latitude]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Distance')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-distance" class="form-control" name="row[distance]" type="number" value="0">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Url')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-url" class="form-control" name="row[url]" type="text">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="statusList" item="vo"}
<label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="1"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Exp')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-exp" data-rule="required" class="form-control" name="row[exp]" type="number">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('View')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-view" class="form-control" name="row[view]" type="number" value="0">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Images')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-images" class="form-control" size="50" name="row[images]" type="text">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="plupload-images" class="btn btn-danger plupload" data-input-id="c-images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="true" data-preview-id="p-images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-images" class="btn btn-primary fachoose" data-input-id="c-images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
<span class="msg-box n-right" for="c-images"></span>
</div>
<ul class="row list-inline plupload-preview" id="p-images"></ul>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('User_is_up')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-user_is_up" class="form-control selectpicker" name="row[user_is_up]">
{foreach name="userIsUpList" item="vo"}
<option value="{$key}" {in name="key" value="1"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Admin_is_up')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-admin_is_up" class="form-control selectpicker" name="row[admin_is_up]">
{foreach name="adminIsUpList" item="vo"}
<option value="{$key}" {in name="key" value="1"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('User_deletetime')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-user_deletetime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[user_deletetime]" type="text" value="{:date('Y-m-d H:i:s')}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Admin_deletetime')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-admin_deletetime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[admin_deletetime]" type="text" value="{:date('Y-m-d H:i:s')}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Question')}:</label>
<div class="col-xs-12 col-sm-8">
<textarea id="c-question" class="form-control " rows="5" name="row[question]" cols="50"></textarea>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Area')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-area" class="form-control" name="row[area]" 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">{:__('Goods_name')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-goods_name" data-rule="required" class="form-control" name="row[goods_name]" type="text" value="{$row.goods_name|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Type')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-type" data-rule="required" class="form-control selectpicker" name="row[type]">
{foreach name="typeList" item="vo"}
<option value="{$key}" {in name="key" value="$row.type"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Video')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-video" class="form-control" name="row[video]" type="text" value="{$row.video|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Voice')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-voice" class="form-control" name="row[voice]" type="text" value="{$row.voice|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">
<textarea id="c-content" class="form-control editor" rows="5" name="row[content]" cols="50">{$row.content|htmlentities}</textarea>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('View_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-view_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[view_time]" type="text" value="{:$row.view_time?datetime($row.view_time):''}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Start_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-start_time" data-rule="required" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[start_time]" type="text" value="{:$row.start_time?datetime($row.start_time):''}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('End_time')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-end_time" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[end_time]" type="text" value="{:$row.end_time?datetime($row.end_time):''}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Sex')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-sex" class="form-control selectpicker" name="row[sex]">
{foreach name="sexList" item="vo"}
<option value="{$key}" {in name="key" value="$row.sex"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Min_age')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-min_age" class="form-control" name="row[min_age]" type="number" value="{$row.min_age|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Max_age')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-max_age" class="form-control" name="row[max_age]" type="number" value="{$row.max_age|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Province')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-province" data-rule="required" class="form-control" name="row[province]" type="text" value="{$row.province|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('City')}:</label>
<div class="col-xs-12 col-sm-8">
<div class='control-relative'><input id="c-city" data-rule="required" class="form-control" data-toggle="city-picker" name="row[city]" type="text" value="{$row.city|htmlentities}"></div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('County')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-county" data-rule="required" class="form-control" name="row[county]" type="text" value="{$row.county|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Address')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-address" data-rule="required" class="form-control" name="row[address]" type="text" value="{$row.address|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Longitude')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-longitude" data-rule="required" class="form-control" name="row[longitude]" type="text" value="{$row.longitude|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Latitude')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-latitude" data-rule="required" class="form-control" name="row[latitude]" type="text" value="{$row.latitude|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Distance')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-distance" class="form-control" name="row[distance]" type="number" value="{$row.distance|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Url')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-url" class="form-control" name="row[url]" type="text" value="{$row.url|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Status')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="radio">
{foreach name="statusList" item="vo"}
<label for="row[status]-{$key}"><input id="row[status]-{$key}" name="row[status]" type="radio" value="{$key}" {in name="key" value="$row.status"}checked{/in} /> {$vo}</label>
{/foreach}
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Exp')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-exp" data-rule="required" class="form-control" name="row[exp]" type="number" value="{$row.exp|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('View')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-view" class="form-control" name="row[view]" type="number" value="{$row.view|htmlentities}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Images')}:</label>
<div class="col-xs-12 col-sm-8">
<div class="input-group">
<input id="c-images" class="form-control" size="50" name="row[images]" type="text" value="{$row.images|htmlentities}">
<div class="input-group-addon no-border no-padding">
<span><button type="button" id="plupload-images" class="btn btn-danger plupload" data-input-id="c-images" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/bmp" data-multiple="true" data-preview-id="p-images"><i class="fa fa-upload"></i> {:__('Upload')}</button></span>
<span><button type="button" id="fachoose-images" class="btn btn-primary fachoose" data-input-id="c-images" data-mimetype="image/*" data-multiple="true"><i class="fa fa-list"></i> {:__('Choose')}</button></span>
</div>
<span class="msg-box n-right" for="c-images"></span>
</div>
<ul class="row list-inline plupload-preview" id="p-images"></ul>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('User_is_up')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-user_is_up" class="form-control selectpicker" name="row[user_is_up]">
{foreach name="userIsUpList" item="vo"}
<option value="{$key}" {in name="key" value="$row.user_is_up"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Admin_is_up')}:</label>
<div class="col-xs-12 col-sm-8">
<select id="c-admin_is_up" class="form-control selectpicker" name="row[admin_is_up]">
{foreach name="adminIsUpList" item="vo"}
<option value="{$key}" {in name="key" value="$row.admin_is_up"}selected{/in}>{$vo}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('User_deletetime')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-user_deletetime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[user_deletetime]" type="text" value="{:$row.user_deletetime?datetime($row.user_deletetime):''}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Admin_deletetime')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-admin_deletetime" class="form-control datetimepicker" data-date-format="YYYY-MM-DD HH:mm:ss" data-use-current="true" name="row[admin_deletetime]" type="text" value="{:$row.admin_deletetime?datetime($row.admin_deletetime):''}">
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Question')}:</label>
<div class="col-xs-12 col-sm-8">
<textarea id="c-question" class="form-control " rows="5" name="row[question]" cols="50">{$row.question|htmlentities}</textarea>
</div>
</div>
<div class="form-group">
<label class="control-label col-xs-12 col-sm-2">{:__('Area')}:</label>
<div class="col-xs-12 col-sm-8">
<input id="c-area" class="form-control" name="row[area]" type="text" value="{$row.area|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">
<!--<div class="panel-heading">-->
<!--{:build_heading(null,FALSE)}-->
<!--<ul class="nav nav-tabs" data-field="status">-->
<!--<li class="active"><a href="#t-all" data-value="" data-toggle="tab">{:__('All')}</a></li>-->
<!--{foreach name="statusList" item="vo"}-->
<!--<li><a href="#t-{$key}" data-value="{$key}" data-toggle="tab">{$vo}</a></li>-->
<!--{/foreach}-->
<!--</ul>-->
<!--</div>-->
<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('goods_audit/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('goods_audit/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('goods_audit/del')?'':'hide'}" title="{:__('Delete')}" ><i class="fa fa-trash"></i> {:__('Delete')}</a>-->
<!--<a href="javascript:;" class="btn btn-danger btn-import {:$auth->check('goods_audit/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('goods_audit/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('goods_audit/edit')}"
data-operate-del="{:$auth->check('goods_audit/del')}"
width="100%">
</table>
</div>
</div>
</div>
</div>
</div>
... ...
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
index_url: 'goods/index' + location.search,
// add_url: 'goods/add',
edit_url: 'goods/edit',
del_url: 'goods/del',
multi_url: 'goods/multi',
table: 'goods',
}
});
var table = $("#table");
// 初始化表格
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'id',
sortName: 'id',
columns: [
[
{checkbox: true},
{field: 'id', title: __('Id')},
{field: 'admin_id', title: __('Admin_id'), visible:false},
{field: 'admin.merchant_title', title: __('Admin.merchant_title')},
{field: 'admin.merchant_name', title: __('Admin.merchant_name')},
{field: 'admin.merchant_mobile', title: __('Admin.merchant_mobile')},
{field: 'type', title: __('广告类型'), searchList: {"3":__('图文'),"2":__('音频'),"1":__('视频')}, formatter: Table.api.formatter.label},
{field: 'goods_name', title: __('Goods_name')},
// {field: 'video', title: __('Video')},
// {field: 'voice', title: __('Voice')},
// {field: 'view_time', title: __('View_time'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'start_time', title: __('Start_time'), operate:false, addclass:'datetimerange', formatter: Table.api.formatter.datetime,datetimeFormat:"YYYY-MM-DD",},
{field: 'end_time', title: __('End_time'), operate:false, addclass:'datetimerange', formatter: Table.api.formatter.datetime,datetimeFormat:"YYYY-MM-DD",},
// {field: 'sex', title: __('Sex'), searchList: {"2":__('Sex 2'),"1":__('Sex 1'),"0":__('Sex 0')}, formatter: Table.api.formatter.normal},
// {field: 'min_age', title: __('Min_age')},
// {field: 'max_age', title: __('Max_age')},
// {field: 'province', title: __('Province')},
// {field: 'city', title: __('City')},
// {field: 'county', title: __('County')},
// {field: 'address', title: __('Address')},
// {field: 'longitude', title: __('Longitude')},
// {field: 'latitude', title: __('Latitude')},
// {field: 'distance', title: __('Distance'), operate:'BETWEEN'},
// {field: 'url', title: __('Url'), formatter: Table.api.formatter.url},
{field: 'exp', title: __('Exp'), operate:false},
// {field: 'view', title: __('View')},
// {field: 'images', title: __('Images'), events: Table.api.events.image, formatter: Table.api.formatter.images},
// {field: 'admin_deletetime', title: __('Admin_deletetime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'updatetime', title: __('Updatetime'), operate:false, addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'user_is_up', title: __('商户端上架状态'), searchList: {"1":__('已上架'),"0":__('已下架')}, formatter: Table.api.formatter.label},
{field: 'admin_is_up', title: __('管理端上架状态'), searchList: {"1":__('已上架'),"0":__('已下架')}, formatter: Table.api.formatter.label},
{field: 'user_deletetime', title: __('商户端删除时间'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'status', title: __('审核状态'), searchList: {"3":__('审核失败'),"2":__('审核通过'),"1":__('待审核')}, formatter: Table.api.formatter.status},
/*{field: 'admin.id', title: __('Admin.id')},
{field: 'admin.username', title: __('Admin.username')},
{field: 'admin.nickname', title: __('Admin.nickname')},
{field: 'admin.password', title: __('Admin.password')},
{field: 'admin.salt', title: __('Admin.salt')},
{field: 'admin.avatar', title: __('Admin.avatar'), events: Table.api.events.image, formatter: Table.api.formatter.image},
{field: 'admin.email', title: __('Admin.email')},
{field: 'admin.loginfailure', title: __('Admin.loginfailure')},
{field: 'admin.logintime', title: __('Admin.logintime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'admin.createtime', title: __('Admin.createtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'admin.updatetime', title: __('Admin.updatetime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'admin.token', title: __('Admin.token')},
{field: 'admin.status', title: __('Admin.status'), formatter: Table.api.formatter.status},
{field: 'admin.user_id', title: __('Admin.user_id')},
{field: 'admin.money', title: __('Admin.money')},
{field: 'admin.merchant_title', title: __('Admin.merchant_title')},
{field: 'admin.merchant_name', title: __('Admin.merchant_name')},
{field: 'admin.merchant_mobile', title: __('Admin.merchant_mobile')},
{field: 'admin.area', title: __('Admin.area')},
{field: 'admin.brief', title: __('Admin.brief')},
{field: 'admin.business_images', title: __('Admin.business_images'), events: Table.api.events.image, formatter: Table.api.formatter.images},
{field: 'admin.other_images', title: __('Admin.other_images'), events: Table.api.events.image, formatter: Table.api.formatter.images},*/
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate,
buttons: [
{
name: 'ajax',
text: __('通过'),
title: __('通过'),
classname: 'btn btn-xs btn-success btn-ajax',
confirm: '确认发送',
icon: false,
url: 'goods/status/ids/{id}/status/2',
hidden: function(row){
if(row.status != 1){
return true;
}
},
success: function (data, ret) {
// Layer.alert(ret.msg + ",返回数据:" + JSON.stringify(data));
//如果需要阻止成功提示,则必须使用return false;
//return false;
},
error: function (data, ret) {
console.log(data, ret);
Layer.alert(ret.msg);
return false;
},
visible: function (row) {
//返回true时按钮显示,返回false隐藏
return true;
},
refresh: true
},
{
name: 'ajax',
text: __('拒绝'),
title: __('拒绝'),
classname: 'btn btn-xs btn-danger btn-ajax',
confirm: '确认发送',
icon: false,
url: 'goods/status/ids/{id}/status/3',
hidden: function(row){
if(row.status != 1){
return true;
}
},
success: function (data, ret) {
Layer.alert(ret.msg + ",返回数据:" + JSON.stringify(data));
//如果需要阻止成功提示,则必须使用return false;
//return false;
},
error: function (data, ret) {
console.log(data, ret);
Layer.alert(ret.msg);
return false;
},
visible: function (row) {
//返回true时按钮显示,返回false隐藏
return true;
},
refresh: true
},
],
}
]
]
});
// 为表格绑定事件
Table.api.bindevent(table);
},
add: function () {
type_init();
$('.type').click(function(){
type_init();
});
function type_init(){
var val=$('input:radio[name="row[type]"]:checked').val();
if(val == 1){
//视频
$('.video').show();
$('.voice').hide();
$('.content2').hide();
$('.view_time').hide();
}else if(val == 2){
//音频
$('.video').hide();
$('.voice').show();
$('.content2').hide();
$('.view_time').hide();
}else if(val == 3){
//图文
$('.video').hide();
$('.voice').hide();
$('.content2').show();
$('.view_time').show();
}
}
Controller.api.bindevent();
},
edit: function () {
type_init();
$('.type').click(function(){
type_init();
});
function type_init(){
var val=$('input:radio[name="row[type]"]:checked').val();
if(val == 1){
//视频
$('.video').show();
$('.voice').hide();
$('.content2').hide();
$('.view_time').hide();
}else if(val == 2){
//音频
$('.video').hide();
$('.voice').show();
$('.content2').hide();
$('.view_time').hide();
}else if(val == 3){
//图文
$('.video').hide();
$('.voice').hide();
$('.content2').show();
$('.view_time').show();
}
}
Controller.api.bindevent();
},
api: {
bindevent: function () {
Form.api.bindevent($("form[role=form]"));
}
}
};
return Controller;
});
\ No newline at end of file
... ...
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
var Controller = {
index: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
index_url: 'goods_audit/index' + location.search,
// add_url: 'goods_audit/add',
edit_url: 'goods_audit/edit',
// del_url: 'goods_audit/del',
multi_url: 'goods_audit/multi',
table: 'goods',
}
});
var table = $("#table");
// 初始化表格
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'id',
sortName: 'id',
columns: [
[
{checkbox: true},
{field: 'id', title: __('Id')},
{field: 'admin_id', title: __('Admin_id'), visible:false},
{field: 'admin.merchant_title', title: __('Admin.merchant_title')},
{field: 'admin.merchant_name', title: __('Admin.merchant_name')},
{field: 'admin.merchant_mobile', title: __('Admin.merchant_mobile')},
{field: 'type', title: __('广告类型'), searchList: {"3":__('图文'),"2":__('音频'),"1":__('视频')}, formatter: Table.api.formatter.label},
{field: 'goods_name', title: __('Goods_name')},
// {field: 'video', title: __('Video')},
// {field: 'voice', title: __('Voice')},
// {field: 'view_time', title: __('View_time'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'start_time', title: __('Start_time'), operate:false, addclass:'datetimerange', formatter: Table.api.formatter.datetime,datetimeFormat:"YYYY-MM-DD",},
{field: 'end_time', title: __('End_time'), operate:false, addclass:'datetimerange', formatter: Table.api.formatter.datetime,datetimeFormat:"YYYY-MM-DD",},
// {field: 'sex', title: __('Sex'), searchList: {"2":__('Sex 2'),"1":__('Sex 1'),"0":__('Sex 0')}, formatter: Table.api.formatter.normal},
// {field: 'min_age', title: __('Min_age')},
// {field: 'max_age', title: __('Max_age')},
// {field: 'province', title: __('Province')},
// {field: 'city', title: __('City')},
// {field: 'county', title: __('County')},
// {field: 'address', title: __('Address')},
// {field: 'longitude', title: __('Longitude')},
// {field: 'latitude', title: __('Latitude')},
// {field: 'distance', title: __('Distance'), operate:'BETWEEN'},
// {field: 'url', title: __('Url'), formatter: Table.api.formatter.url},
{field: 'exp', title: __('Exp'), operate:false},
// {field: 'view', title: __('View')},
// {field: 'images', title: __('Images'), events: Table.api.events.image, formatter: Table.api.formatter.images},
// {field: 'admin_deletetime', title: __('Admin_deletetime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'updatetime', title: __('Updatetime'), operate:false, addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'user_is_up', title: __('商户端上架状态'), searchList: {"1":__('已上架'),"0":__('已下架')}, formatter: Table.api.formatter.label},
{field: 'admin_is_up', title: __('管理端上架状态'), searchList: {"1":__('已上架'),"0":__('已下架')}, formatter: Table.api.formatter.label},
{field: 'user_deletetime', title: __('商户端删除时间'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'status', title: __('审核状态'), searchList: {"3":__('审核失败'),"2":__('审核通过'),"1":__('待审核')}, formatter: Table.api.formatter.status},
/*{field: 'admin.id', title: __('Admin.id')},
{field: 'admin.username', title: __('Admin.username')},
{field: 'admin.nickname', title: __('Admin.nickname')},
{field: 'admin.password', title: __('Admin.password')},
{field: 'admin.salt', title: __('Admin.salt')},
{field: 'admin.avatar', title: __('Admin.avatar'), events: Table.api.events.image, formatter: Table.api.formatter.image},
{field: 'admin.email', title: __('Admin.email')},
{field: 'admin.loginfailure', title: __('Admin.loginfailure')},
{field: 'admin.logintime', title: __('Admin.logintime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'admin.createtime', title: __('Admin.createtime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'admin.updatetime', title: __('Admin.updatetime'), operate:'RANGE', addclass:'datetimerange', formatter: Table.api.formatter.datetime},
{field: 'admin.token', title: __('Admin.token')},
{field: 'admin.status', title: __('Admin.status'), formatter: Table.api.formatter.status},
{field: 'admin.user_id', title: __('Admin.user_id')},
{field: 'admin.money', title: __('Admin.money')},
{field: 'admin.merchant_title', title: __('Admin.merchant_title')},
{field: 'admin.merchant_name', title: __('Admin.merchant_name')},
{field: 'admin.merchant_mobile', title: __('Admin.merchant_mobile')},
{field: 'admin.area', title: __('Admin.area')},
{field: 'admin.brief', title: __('Admin.brief')},
{field: 'admin.business_images', title: __('Admin.business_images'), events: Table.api.events.image, formatter: Table.api.formatter.images},
{field: 'admin.other_images', title: __('Admin.other_images'), events: Table.api.events.image, formatter: Table.api.formatter.images},*/
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate,
buttons: [
{
name: 'ajax',
text: __('通过'),
title: __('通过'),
classname: 'btn btn-xs btn-success btn-ajax',
confirm: '确认发送',
icon: false,
url: 'goods/status/ids/{id}/status/2',
hidden: function(row){
if(row.status != 1){
return true;
}
},
success: function (data, ret) {
// Layer.alert(ret.msg + ",返回数据:" + JSON.stringify(data));
//如果需要阻止成功提示,则必须使用return false;
//return false;
},
error: function (data, ret) {
console.log(data, ret);
Layer.alert(ret.msg);
return false;
},
visible: function (row) {
//返回true时按钮显示,返回false隐藏
return true;
},
refresh: true
},
{
name: 'ajax',
text: __('拒绝'),
title: __('拒绝'),
classname: 'btn btn-xs btn-danger btn-ajax',
confirm: '确认发送',
icon: false,
url: 'goods/status/ids/{id}/status/3',
hidden: function(row){
if(row.status != 1){
return true;
}
},
success: function (data, ret) {
Layer.alert(ret.msg + ",返回数据:" + JSON.stringify(data));
//如果需要阻止成功提示,则必须使用return false;
//return false;
},
error: function (data, ret) {
console.log(data, ret);
Layer.alert(ret.msg);
return false;
},
visible: function (row) {
//返回true时按钮显示,返回false隐藏
return true;
},
refresh: true
},
],
}
]
]
});
// 为表格绑定事件
Table.api.bindevent(table);
},
add: function () {
type_init();
$('.type').click(function(){
type_init();
});
function type_init(){
var val=$('input:radio[name="row[type]"]:checked').val();
if(val == 1){
//视频
$('.video').show();
$('.voice').hide();
$('.content2').hide();
$('.view_time').hide();
}else if(val == 2){
//音频
$('.video').hide();
$('.voice').show();
$('.content2').hide();
$('.view_time').hide();
}else if(val == 3){
//图文
$('.video').hide();
$('.voice').hide();
$('.content2').show();
$('.view_time').show();
}
}
Controller.api.bindevent();
},
edit: function () {
type_init();
$('.type').click(function(){
type_init();
});
function type_init(){
var val=$('input:radio[name="row[type]"]:checked').val();
if(val == 1){
//视频
$('.video').show();
$('.voice').hide();
$('.content2').hide();
$('.view_time').hide();
}else if(val == 2){
//音频
$('.video').hide();
$('.voice').show();
$('.content2').hide();
$('.view_time').hide();
}else if(val == 3){
//图文
$('.video').hide();
$('.voice').hide();
$('.content2').show();
$('.view_time').show();
}
}
Controller.api.bindevent();
},
api: {
bindevent: function () {
Form.api.bindevent($("form[role=form]"));
}
}
};
return Controller;
});
\ No newline at end of file
... ...