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

添加环保知识

... ... @@ -2,10 +2,14 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="0011664b-87e9-41bd-9f37-18792fb15777" name="Default" comment="">
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/app/admin/controller/KnowController.php" />
<change type="NEW" beforePath="" afterPath="$PROJECT_DIR$/public/themes/admin_simpleboot3/admin/know/index.html" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/api/index/controller/OrderController.php" afterPath="$PROJECT_DIR$/api/index/controller/OrderController.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/api/index/controller/PayController.php" afterPath="$PROJECT_DIR$/api/index/controller/PayController.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/api/index/controller/UserController.php" afterPath="$PROJECT_DIR$/api/index/controller/UserController.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/api/index/controller/RecycleController.php" afterPath="$PROJECT_DIR$/api/index/controller/RecycleController.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/data/conf/route.php" afterPath="$PROJECT_DIR$/data/conf/route.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/data/lang/zh-cn/admin_menu.php" afterPath="$PROJECT_DIR$/data/lang/zh-cn/admin_menu.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/public/themes/admin_simpleboot3/admin/build/index.html" afterPath="$PROJECT_DIR$/public/themes/admin_simpleboot3/admin/build/index.html" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
... ... @@ -27,22 +31,44 @@
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="OrderController.php" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/api/index/controller/OrderController.php">
<file leaf-file-name="RecycleController.php" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/api/index/controller/RecycleController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="419">
<caret line="154" column="54" lean-forward="false" selection-start-line="154" selection-start-column="54" selection-end-line="154" selection-end-column="54" />
<state relative-caret-position="1391">
<caret line="489" column="5" lean-forward="false" selection-start-line="489" selection-start-column="5" selection-end-line="489" selection-end-column="5" />
<folding>
<element signature="e#131#162#0#PHP" expanded="true" />
<element signature="e#330#602#0#PHP" expanded="false" />
<element signature="e#608#968#0#PHP" expanded="false" />
<element signature="e#973#1861#0#PHP" expanded="false" />
<element signature="e#1867#2104#0#PHP" expanded="false" />
<element signature="e#2109#2809#0#PHP" expanded="false" />
<element signature="e#2815#3057#0#PHP" expanded="false" />
<element signature="e#3063#3300#0#PHP" expanded="false" />
<element signature="e#3305#3377#0#PHP" expanded="false" />
<element signature="e#3383#3830#0#PHP" expanded="false" />
<element signature="e#321#575#0#PHP" expanded="false" />
<element signature="e#580#865#0#PHP" expanded="false" />
<element signature="e#871#1206#0#PHP" expanded="false" />
<element signature="e#1211#1708#0#PHP" expanded="false" />
<element signature="e#1714#1974#0#PHP" expanded="false" />
<element signature="e#1979#2268#0#PHP" expanded="false" />
<element signature="e#2274#2613#0#PHP" expanded="false" />
<element signature="e#2618#3121#0#PHP" expanded="false" />
<element signature="e#3127#3343#0#PHP" expanded="false" />
<element signature="e#3348#3717#0#PHP" expanded="false" />
<element signature="e#3723#4025#0#PHP" expanded="false" />
<element signature="e#4030#4429#0#PHP" expanded="false" />
<element signature="e#4435#4632#0#PHP" expanded="false" />
<element signature="e#4637#4894#0#PHP" expanded="false" />
<element signature="e#4900#5096#0#PHP" expanded="false" />
<element signature="e#5101#5363#0#PHP" expanded="false" />
<element signature="e#5369#5796#0#PHP" expanded="false" />
<element signature="e#5801#6358#0#PHP" expanded="false" />
<element signature="e#6364#6707#0#PHP" expanded="false" />
<element signature="e#6712#7193#0#PHP" expanded="false" />
<element signature="e#7199#7532#0#PHP" expanded="false" />
<element signature="e#7537#7892#0#PHP" expanded="false" />
<element signature="e#7898#8251#0#PHP" expanded="false" />
<element signature="e#8256#8661#0#PHP" expanded="false" />
<element signature="e#8667#9050#0#PHP" expanded="false" />
<element signature="e#9055#9722#0#PHP" expanded="false" />
<element signature="e#9728#10172#0#PHP" expanded="false" />
<element signature="e#10177#11024#0#PHP" expanded="false" />
<element signature="e#11030#11298#0#PHP" expanded="false" />
<element signature="e#11303#11775#0#PHP" expanded="false" />
<element signature="e#11781#12087#0#PHP" expanded="false" />
<element signature="e#12092#12809#0#PHP" expanded="false" />
</folding>
</state>
</provider>
... ... @@ -68,8 +94,6 @@
<component name="IdeDocumentHistory">
<option name="CHANGED_PATHS">
<list>
<option value="$PROJECT_DIR$/app/index/model/ShopgoodsModel.php" />
<option value="$PROJECT_DIR$/app/index/controller/DoorController.php" />
<option value="$PROJECT_DIR$/app/admin/controller/ShopgoodsController.php" />
<option value="$PROJECT_DIR$/public/themes/admin_simpleboot3/admin/point/add.html" />
<option value="$PROJECT_DIR$/public/themes/admin_simpleboot3/admin/point/index.html" />
... ... @@ -100,10 +124,8 @@
<option value="$PROJECT_DIR$/api/index/model/ShoptypeModel.php" />
<option value="$PROJECT_DIR$/api/index/model/ShoppicModel.php" />
<option value="$PROJECT_DIR$/app/admin/controller/BuildController.php" />
<option value="$PROJECT_DIR$/public/themes/admin_simpleboot3/admin/build/index.html" />
<option value="$PROJECT_DIR$/api/index/model/ShopgoodsModel.php" />
<option value="$PROJECT_DIR$/api/index/controller/ShopgoodsController.php" />
<option value="$PROJECT_DIR$/api/index/controller/RecycleController.php" />
<option value="$PROJECT_DIR$/simplewind/cmf/common.php" />
<option value="$PROJECT_DIR$/public/themes/admin_simpleboot3/admin/money/index.html" />
<option value="$PROJECT_DIR$/public/themes/admin_simpleboot3/admin/money/add.html" />
... ... @@ -117,8 +139,12 @@
<option value="$PROJECT_DIR$/api/config.php" />
<option value="$PROJECT_DIR$/app/config.php" />
<option value="$PROJECT_DIR$/api/index/controller/UserController.php" />
<option value="$PROJECT_DIR$/api/index/controller/PayController.php" />
<option value="$PROJECT_DIR$/api/index/controller/OrderController.php" />
<option value="$PROJECT_DIR$/api/index/controller/PayController.php" />
<option value="$PROJECT_DIR$/app/admin/controller/KnowController.php" />
<option value="$PROJECT_DIR$/public/themes/admin_simpleboot3/admin/know/index.html" />
<option value="$PROJECT_DIR$/public/themes/admin_simpleboot3/admin/build/index.html" />
<option value="$PROJECT_DIR$/api/index/controller/RecycleController.php" />
</list>
</option>
</component>
... ... @@ -136,11 +162,11 @@
<sorting>DEFINITION_ORDER</sorting>
</component>
<component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
<component name="ProjectFrameBounds">
<option name="x" value="480" />
<option name="y" value="69" />
<component name="ProjectFrameBounds" extendedState="1">
<option name="x" value="82" />
<option name="y" value="37" />
<option name="width" value="1935" />
<option name="height" value="1006" />
<option name="height" value="1003" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1">
... ... @@ -192,7 +218,7 @@
</component>
<component name="PropertiesComponent">
<property name="WebServerToolWindowFactoryState" value="false" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
<property name="last_opened_file_path" value="$PROJECT_DIR$/../../project1/resource" />
<property name="DefaultHtmlFileTemplate" value="HTML File" />
</component>
<component name="RecentsManager">
... ... @@ -261,18 +287,17 @@
<workItem from="1573690800296" duration="20605000" />
<workItem from="1573724518247" duration="1337000" />
<workItem from="1573726096905" duration="2420000" />
<workItem from="1573780685042" duration="2872000" />
<workItem from="1573780685042" duration="12526000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="266764000" />
<option name="totallyTimeSpent" value="276418000" />
</component>
<component name="ToolWindowManager">
<frame x="480" y="69" width="1935" height="1006" extended-state="0" />
<editor active="true" />
<frame x="82" y="37" width="1935" height="1003" extended-state="1" />
<layout>
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.16693333" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.16693333" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.33" sideWeight="0.5" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Database" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" show_stripe_button="true" weight="0.32982457" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
... ... @@ -318,25 +343,11 @@
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<option name="time" value="7" />
<option name="time" value="8" />
</breakpoint-manager>
<watches-manager />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/app/index/model/ShoptypeModel.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="250">
<caret line="15" column="4" lean-forward="false" selection-start-line="15" selection-start-column="4" selection-end-line="20" selection-end-column="5" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/index/model/ShopgoodsModel.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="125">
<caret line="15" column="4" lean-forward="true" selection-start-line="15" selection-start-column="4" selection-end-line="45" selection-end-column="5" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/api/index/model/ShoptypeModel.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="275">
... ... @@ -393,20 +404,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/admin/controller/BuildController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="800">
<caret line="37" column="35" lean-forward="false" selection-start-line="37" selection-start-column="35" selection-end-line="37" selection-end-column="35" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/public/themes/admin_simpleboot3/admin/build/index.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="358">
<caret line="69" column="9" lean-forward="true" selection-start-line="69" selection-start-column="9" selection-end-line="69" selection-end-column="9" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/api/index/model/ShopgoodsModel.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="125">
... ... @@ -414,14 +411,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/simplewind/thinkphp/library/think/Request.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="310">
<caret line="269" column="20" lean-forward="false" selection-start-line="269" selection-start-column="20" selection-end-line="269" selection-end-column="20" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/simplewind/thinkphp/library/think/session/driver/Redis.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="250">
... ... @@ -444,13 +433,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/api/index/controller/RecycleController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="487">
<caret line="261" column="14" lean-forward="true" selection-start-line="261" selection-start-column="14" selection-end-line="261" selection-end-column="14" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/admin/controller/FeeController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="0">
... ... @@ -681,49 +663,142 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/api/index/controller/ShopgoodsController.php">
<entry file="file://$PROJECT_DIR$/api/index/controller/OrderController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="375">
<caret line="62" column="64" lean-forward="true" selection-start-line="61" selection-start-column="7" selection-end-line="62" selection-end-column="64" />
<folding />
<state relative-caret-position="419">
<caret line="154" column="54" lean-forward="false" selection-start-line="154" selection-start-column="54" selection-end-line="154" selection-end-column="54" />
<folding>
<element signature="e#131#162#0#PHP" expanded="false" />
<element signature="e#330#602#0#PHP" expanded="false" />
<element signature="e#608#968#0#PHP" expanded="false" />
<element signature="e#973#1861#0#PHP" expanded="false" />
<element signature="e#1867#2104#0#PHP" expanded="false" />
<element signature="e#2109#2809#0#PHP" expanded="false" />
<element signature="e#2815#3057#0#PHP" expanded="false" />
<element signature="e#3063#3300#0#PHP" expanded="false" />
<element signature="e#3305#3377#0#PHP" expanded="false" />
<element signature="e#3383#3830#0#PHP" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/api/index/controller/PayController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="25">
<caret line="90" column="38" lean-forward="true" selection-start-line="90" selection-start-column="38" selection-end-line="90" selection-end-column="38" />
<state relative-caret-position="550">
<caret line="108" column="85" lean-forward="false" selection-start-line="108" selection-start-column="85" selection-end-line="108" selection-end-column="85" />
<folding>
<element signature="e#324#855#0#PHP" expanded="false" />
<element signature="e#409#848#0#PHP" expanded="false" />
<element signature="e#861#925#0#PHP" expanded="false" />
<element signature="e#930#1766#0#PHP" expanded="false" />
<element signature="e#1772#1853#0#PHP" expanded="false" />
<element signature="e#3850#3873#0#PHP" expanded="false" />
<element signature="e#3878#4137#0#PHP" expanded="false" />
<element signature="e#4144#4193#0#PHP" expanded="false" />
<element signature="e#4198#4626#0#PHP" expanded="false" />
<element signature="e#4632#4696#0#PHP" expanded="false" />
<element signature="e#4701#5575#0#PHP" expanded="false" />
<element signature="e#3939#3962#0#PHP" expanded="false" />
<element signature="e#3967#4226#0#PHP" expanded="false" />
<element signature="e#4233#4282#0#PHP" expanded="false" />
<element signature="e#4287#4715#0#PHP" expanded="false" />
<element signature="e#4721#4785#0#PHP" expanded="false" />
<element signature="e#4790#5664#0#PHP" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/api/index/controller/OrderController.php">
<entry file="file://$PROJECT_DIR$/simplewind/thinkphp/library/think/Request.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="419">
<caret line="154" column="54" lean-forward="false" selection-start-line="154" selection-start-column="54" selection-end-line="154" selection-end-column="54" />
<state relative-caret-position="280">
<caret line="269" column="20" lean-forward="false" selection-start-line="269" selection-start-column="20" selection-end-line="269" selection-end-column="20" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/api/index/controller/ShopgoodsController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="116">
<caret line="42" column="4" lean-forward="false" selection-start-line="42" selection-start-column="4" selection-end-line="58" selection-end-column="7" />
<folding>
<element signature="e#131#162#0#PHP" expanded="true" />
<element signature="e#330#602#0#PHP" expanded="false" />
<element signature="e#608#968#0#PHP" expanded="false" />
<element signature="e#973#1861#0#PHP" expanded="false" />
<element signature="e#1867#2104#0#PHP" expanded="false" />
<element signature="e#2109#2809#0#PHP" expanded="false" />
<element signature="e#2815#3057#0#PHP" expanded="false" />
<element signature="e#3063#3300#0#PHP" expanded="false" />
<element signature="e#3305#3377#0#PHP" expanded="false" />
<element signature="e#3383#3830#0#PHP" expanded="false" />
<element signature="e#797#1266#0#PHP" expanded="false" />
<element signature="e#2045#2263#0#PHP" expanded="false" />
<element signature="e#2268#2476#0#PHP" expanded="false" />
<element signature="e#2482#2814#0#PHP" expanded="false" />
<element signature="e#2819#3199#0#PHP" expanded="false" />
<element signature="e#3205#3717#0#PHP" expanded="false" />
<element signature="e#3722#4285#0#PHP" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/admin/controller/BuildController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="250">
<caret line="17" column="4" lean-forward="false" selection-start-line="17" selection-start-column="4" selection-end-line="45" selection-end-column="5" />
<folding>
<element signature="e#262#1156#0#PHP" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/public/themes/admin_simpleboot3/admin/build/index.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="333">
<caret line="35" column="32" lean-forward="false" selection-start-line="35" selection-start-column="32" selection-end-line="35" selection-end-column="32" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/app/admin/controller/KnowController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="366">
<caret line="25" column="32" lean-forward="true" selection-start-line="25" selection-start-column="32" selection-end-line="25" selection-end-column="32" />
<folding>
<element signature="e#131#170#0#PHP" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/public/themes/admin_simpleboot3/admin/know/index.html">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="150">
<caret line="51" column="88" lean-forward="true" selection-start-line="51" selection-start-column="88" selection-end-line="51" selection-end-column="88" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/api/index/controller/RecycleController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="1391">
<caret line="489" column="5" lean-forward="false" selection-start-line="489" selection-start-column="5" selection-end-line="489" selection-end-column="5" />
<folding>
<element signature="e#321#575#0#PHP" expanded="false" />
<element signature="e#580#865#0#PHP" expanded="false" />
<element signature="e#871#1206#0#PHP" expanded="false" />
<element signature="e#1211#1708#0#PHP" expanded="false" />
<element signature="e#1714#1974#0#PHP" expanded="false" />
<element signature="e#1979#2268#0#PHP" expanded="false" />
<element signature="e#2274#2613#0#PHP" expanded="false" />
<element signature="e#2618#3121#0#PHP" expanded="false" />
<element signature="e#3127#3343#0#PHP" expanded="false" />
<element signature="e#3348#3717#0#PHP" expanded="false" />
<element signature="e#3723#4025#0#PHP" expanded="false" />
<element signature="e#4030#4429#0#PHP" expanded="false" />
<element signature="e#4435#4632#0#PHP" expanded="false" />
<element signature="e#4637#4894#0#PHP" expanded="false" />
<element signature="e#4900#5096#0#PHP" expanded="false" />
<element signature="e#5101#5363#0#PHP" expanded="false" />
<element signature="e#5369#5796#0#PHP" expanded="false" />
<element signature="e#5801#6358#0#PHP" expanded="false" />
<element signature="e#6364#6707#0#PHP" expanded="false" />
<element signature="e#6712#7193#0#PHP" expanded="false" />
<element signature="e#7199#7532#0#PHP" expanded="false" />
<element signature="e#7537#7892#0#PHP" expanded="false" />
<element signature="e#7898#8251#0#PHP" expanded="false" />
<element signature="e#8256#8661#0#PHP" expanded="false" />
<element signature="e#8667#9050#0#PHP" expanded="false" />
<element signature="e#9055#9722#0#PHP" expanded="false" />
<element signature="e#9728#10172#0#PHP" expanded="false" />
<element signature="e#10177#11024#0#PHP" expanded="false" />
<element signature="e#11030#11298#0#PHP" expanded="false" />
<element signature="e#11303#11775#0#PHP" expanded="false" />
<element signature="e#11781#12087#0#PHP" expanded="false" />
<element signature="e#12092#12809#0#PHP" expanded="false" />
</folding>
</state>
</provider>
... ...
... ... @@ -103,9 +103,10 @@ class PayController extends HomeBaseController
->where('user_id',$order['user_id'])
->update($res);
$after_wallet = $res['after_wallet'];
$add_total = $list['add_total'] + $res['total'];
Db::name('integral')
->where('user_id',$order['user_id'])
->update(['now_integral'=>$after_wallet]);
->update(['now_integral'=>$after_wallet,'add_total'=>$add_total]);
} else { // 用户支付失败
$update['status']=1;
}
... ...
... ... @@ -12,6 +12,7 @@ namespace api\index\controller;
use cmf\controller\RestBaseController;
use think\Db;
use think\Request;
use think\Validate;
/**
... ... @@ -203,6 +204,26 @@ class RecycleController extends RestBaseController
}
/**
* @title 回收首页环保知识logo
* @description
* @author GuoSheng
* @url /index/Recycle/know
* @method GET
*
* @return id:ID
* @return thumbnail:图片
*
*/
public function know(){
$data = Db::name('knowledge')
->where('id',1)
->field('id,thumbnail')
->find();
$data['thumbnail'] = cmf_get_image_url($data['thumbnail']);
$this->success('SUCCESS',$data);
}
/**
* @title 回收首页服务评价列表
* @description
* @author GuoSheng
... ... @@ -246,7 +267,7 @@ class RecycleController extends RestBaseController
* @header name:XX-Token require:1 default: desc:token
*
* @return status:状态 (1没有注册过 2注册过)
* @return after_wallet:当前积分
* @return now_integral:当前积分
* @return num:参与次数
* @return add_total:累计积分
*
... ... @@ -261,7 +282,7 @@ class RecycleController extends RestBaseController
$res['status'] = 1;
}else{
$res['status'] = 2;
$res['after_wallet'] = $data['after_wallet'];
$res['now_integral'] = $data['now_integral'];
$res['num'] = $data['num'];
$res['add_total'] = $data['add_total'];
}
... ... @@ -297,13 +318,152 @@ class RecycleController extends RestBaseController
}
/**
* @title 上门回收地址详情
* @description
* @author GuoSheng
* @url /index/Recycle/recycleDetail
* @method GET
*
* @header name:XX-Token require:1 default: desc:token
*
* @param name:id require:1 default: desc:回收地址ID
*
* @return name:姓名
* @return phone:电话
* @return address:详细地址
*
*/
public function recycleDetail()
{
$user_id = $this->getUserId();
$id = $this->request->param('id',0,'intval');
if(empty($id)){
$this -> error(['code'=>40005,'msg'=>'缺少必要参数']);
}
$data = Db::name('recycle')
->where('id',$id)
->field('id,name,phone,address')
->find();
$this->success('SUCCESS',$data);
}
/**
* @title 添加上门回收地址
* @description
* @author GuoSheng
* @url /index/Recycle/addrecycle
* @method GET
*
* @header name:XX-Token require:1 default: desc:token
*
* @param name:name require:1 default: desc:联系人姓名
* @param name:phone require:1 default: desc:联系人电话
* @param name:address require:1 default: desc:联系人详细地址
*
*/
public function addrecycle()
{
$user_id = $this->getUserId();
$param = $this->request->param();
$param['user_id'] = $user_id;
$param['create_time'] = time();
$validate = new Validate([
'name' => 'require',
'phone' => 'require',
'address'=>'require',
]);
if (!$validate->check($param)) {
$this->error(['code'=>40005,'msg'=>$validate->getError()]);
}
$data = Db::name('recycle')
->insert($param);
if(empty($data)){
$this->error(['code'=>40006,'msg'=>'sql执行失败']);
}
$this->success('SUCCESS');
}
/**
* @title 修改上门回收地址
* @description
* @author GuoSheng
* @url /index/Recycle/editrecycle
* @method GET
*
* @header name:XX-Token require:1 default: desc:token
*
* @param name:id require:1 default: desc:回收地址ID
*
* @param name:name require:1 default: desc:联系人姓名
* @param name:phone require:1 default: desc:联系人电话
* @param name:address require:1 default: desc:联系人详细地址
*
*/
public function editrecycle()
{
$user_id = $this->getUserId();
$id = $this->request->param('id',0,'intval');
if(empty($id)){
$this -> error(['code'=>40005,'msg'=>'缺少必要参数']);
}
$param = $this->request->param();
$param['user_id'] = $user_id;
$param['update_time'] = time();
$validate = new Validate([
'name' => 'require',
'phone' => 'require',
'address'=>'require',
]);
if (!$validate->check($param)) {
$this->error(['code'=>40005,'msg'=>$validate->getError()]);
}
$data = Db::name('recycle')
->where('id',$id)
->update($param);
if(empty($data)){
$this->error(['code'=>40006,'msg'=>'sql执行失败']);
}
$this->success('SUCCESS');
}
/**
* @title 删除上门回收地址
* @description
* @author GuoSheng
* @url /index/Recycle/delrecycle
* @method GET
*
* @header name:XX-Token require:1 default: desc:token
*
* @param name:id require:1 default: desc:回收地址ID
*
*/
public function delrecycle()
{
$user_id = $this->getUserId();
$id = $this->request->param('id',0,'intval');
if(empty($id)){
$this -> error(['code'=>40005,'msg'=>'缺少必要参数']);
}
$data = Db::name('recycle')
->where('id',$id)
->update(['delete_time'=>time()]);
if(empty($data)){
$this->error(['code'=>40006,'msg'=>'sql执行失败']);
}
$this->success('SUCCESS');
}
/**
* @title 上传文件
* @description 接口说明
* @author 开发者
* @url /index/Resource/uploadFile
* @url /index/Recycle/uploadFile
* @method POST
* @header name:XX-Token require:1 default: desc:token
* @param name:image type:file require:1 default: other: desc:文件
*
* @param name:image[] type:file require:1 default: other: desc:文件
*
* @return image_url:图片路径
*/
public function uploadFile(){
... ... @@ -311,15 +471,21 @@ class RecycleController extends RestBaseController
if (empty($files)) {
$this->error('未检出文件上传');
}
if($files){
$info = $files->move(ROOT_PATH . 'public' . DS . 'uploads');
$countFile = count($files);
if($countFile > 5) {
$this->error('最多上传5张图片');
}
$url = '';
foreach ($files as $file){
$info = $file->move(ROOT_PATH . 'public' . DS . 'uploads');
if($info){
$request = Request::instance();
$a = $request->domain().'/'.'uploads/'.$info->getSaveName();
$this->success('SUCCESS',$a);
$url .= $a.',';
}else{
$this->error($files->getError());
}
}
$this->success('SUCCESS',rtrim($url,','));
}
}
\ No newline at end of file
... ...
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2019/11/15
* Time: 14:19
*/
namespace app\admin\controller;
use cmf\controller\AdminBaseController;
use think\Db;
use think\Validate;
class KnowController extends AdminBaseController
{
public function index()
{
$id = $this->request->param('id', 1, 'intval');
if ($this->request->isPost()) {
$param = $this->request->param();
$validate = new Validate([
'thumbnail' => 'require',
]);
$validate->message([
'thumbnail' => '缩略图不能为空',
]);
if (!$validate->check($param)) {
$this->error($validate->getError());
}
$param['update_time'] = time();
Db::name('knowledge')
->where('id', $id)
->update($param);
$this->success('更新成功');
} else {
$data = Db::name('knowledge')
->where('id', $id)
->find();
$this->assign([
'data' => $data,
]);
return $this->fetch();
}
}
}
\ No newline at end of file
... ...
... ... @@ -10,6 +10,7 @@ return array (
'ADMIN_HOOK_PLUGINLISTORDER' => '钩子插件排序',
'ADMIN_HOOK_PLUGINS' => '钩子插件管理',
'ADMIN_HOOK_SYNC' => '同步钩子',
'ADMIN_KNOW_INDEX' => '环保知识logo图',
'ADMIN_LINK_ADD' => '添加友情链接',
'ADMIN_LINK_ADDPOST' => '添加友情链接提交保存',
'ADMIN_LINK_DELETE' => '删除友情链接',
... ...
... ... @@ -33,7 +33,7 @@
<div class="col-md-9">
<table class="table table-bordered">
<tr>
<td>缩略图</td>
<td>建筑材料缩略图</td>
<td>
<input type="hidden" name="id" value="{$data.id}">
<input type="hidden" name="thumbnail" id="thumbnail"
... ...
<include file="public@header"/>
</head>
<body>
<!--<script type="text/html" id="photos-item-tpl">-->
<!--<li id="saved-image{id}">-->
<!--<input id="photo-{id}" type="hidden" name="environment[]" value="{filepath}">-->
<!--<img id="photo-{id}-preview" src="{url}" style="height:36px;width: 36px;"-->
<!--onclick="imagePreviewDialog(this.src);">-->
<!--<a href="javascript:uploadOneImage('图片上传','#photo-{id}');">替换</a>-->
<!--<a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a>-->
<!--</li>-->
<!--</script>-->
<script type="text/html" id="photos-item-tpl">
<li id="saved-image{id}">
<input id="photo-{id}" type="hidden" name="images[]" value="{filepath}">
<img id="photo-{id}-preview" src="{url}" style="height:36px;width: 36px;"
onclick="imagePreviewDialog(this.src);">
<a href="javascript:uploadOneImage('图片上传','#photo-{id}');">替换</a>
<a href="javascript:(function(){$('#saved-image{id}').remove();})();">移除</a>
</li>
</script>
<!--<script type="text/html" id="video-item-tpl">-->
<!--<li id="saved-video{id}">-->
<!--<input id="video-{id}" type="hidden" name="video" value="{filepath}">-->
<!--<a id="video-{id}-preview" href="{:cmf_get_image_url('')}{filepath}" target="_blank">查看</a>-->
<!--<a href="javascript:uploadOne('视频上传','#video-{id}','video');">替换</a>-->
<!--<a href="javascript:(function(){$('#saved-video{id}').remove();})();">移除</a>-->
<!--</li>-->
<!--</script>-->
<div class="wrap js-check-wrap">
<form action="{:url('know/index')}" method="post" class="form-horizontal js-ajax-form margin-top-20">
<div class="row">
<div class="col-md-9">
<table class="table table-bordered">
<tr>
<td>专业知识缩略图</td>
<td>
<input type="hidden" name="id" value="{$data.id}">
<input type="hidden" name="thumbnail" id="thumbnail"
value="{$data.thumbnail|default=''}">
<a href="javascript:uploadOneImage('image upload','#thumbnail');">
<if condition="empty($data['thumbnail'])">
<img src="__TMPL__/public/assets/images/default-thumbnail.png"
id="thumbnail-preview"
width="135" style="cursor: pointer"/>
<else/>
<img src="{:cmf_get_image_url($data.thumbnail)}"
id="thumbnail-preview"
width="135" style="cursor: pointer"/>
</if>
</a>
<input type="button" class="btn btn-sm btn-cancel-thumbnail"
value="取消图片">
</td>
</tr>
</table>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary js-ajax-submit">更新</button>
</div>
</div>
</div>
</div>
</form>
</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script type="text/javascript">
//编辑器路径定义
var editorURL = GV.WEB_ROOT;
</script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="__STATIC__/js/ueditor/ueditor.all.min.js"></script>
<script type="text/javascript">
$(function () {
editorcontent = new baidu.editor.ui.Editor();
editorcontent.render('content');
try {
editorcontent.sync();
} catch (err) {
}
$('.btn-cancel-thumbnail').click(function () {
$('#thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#thumbnail').val('');
});
$('.btn-cancel-video_thumbnail').click(function () {
$('#video_thumbnail-preview').attr('src', '__TMPL__/public/assets/images/default-thumbnail.png');
$('#video_thumbnail').val('');
});
});
</script>
</body>
</html>
... ...