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

融资随时保存

... ... @@ -2,8 +2,8 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="73de7205-e736-4b59-941a-a54ab4506a41" name="Default" comment="">
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/.idea/workspace.xml" afterPath="$PROJECT_DIR$/.idea/workspace.xml" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/api/index/controller/FinanceController.php" afterPath="$PROJECT_DIR$/api/index/controller/FinanceController.php" />
<change type="MODIFICATION" beforePath="$PROJECT_DIR$/api/index/controller/SendController.php" afterPath="$PROJECT_DIR$/api/index/controller/SendController.php" />
</list>
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
<option name="TRACKING_ENABLED" value="true" />
... ... @@ -13,7 +13,18 @@
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300" />
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file leaf-file-name="FinanceController.php" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/api/index/controller/FinanceController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="667">
<caret line="72" column="32" lean-forward="false" selection-start-line="72" selection-start-column="32" selection-end-line="72" selection-end-column="32" />
<folding />
</state>
</provider>
</entry>
</file>
</leaf>
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
... ... @@ -92,11 +103,11 @@
<sorting>DEFINITION_ORDER</sorting>
</component>
<component name="PhpWorkspaceProjectConfiguration" backward_compatibility_performed="true" />
<component name="ProjectFrameBounds">
<option name="x" value="285" />
<option name="y" value="92" />
<component name="ProjectFrameBounds" extendedState="1">
<option name="x" value="-80" />
<option name="y" value="80" />
<option name="width" value="1935" />
<option name="height" value="952" />
<option name="height" value="979" />
</component>
<component name="ProjectView">
<navigator currentView="ProjectPane" proportions="" version="1">
... ... @@ -209,17 +220,18 @@
<workItem from="1569315557660" duration="58000" />
<workItem from="1569389764200" duration="1390000" />
<workItem from="1569391173899" duration="1945000" />
<workItem from="1569397269236" duration="1915000" />
<workItem from="1569397269236" duration="3278000" />
</task>
<servers />
</component>
<component name="TimeTrackingManager">
<option name="totallyTimeSpent" value="362734000" />
<option name="totallyTimeSpent" value="364097000" />
</component>
<component name="ToolWindowManager">
<frame x="285" y="92" width="1935" height="952" extended-state="0" />
<frame x="-80" y="80" width="1935" height="979" extended-state="1" />
<editor active="true" />
<layout>
<window_info id="Project" active="true" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.1664" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" show_stripe_button="true" weight="0.1664" 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.34076828" sideWeight="0.50296295" 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.33" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
... ... @@ -584,34 +596,6 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/api/index/controller/FinanceController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="340">
<caret line="49" column="35" lean-forward="true" selection-start-line="49" selection-start-column="35" selection-end-line="49" selection-end-column="35" />
<folding>
<element signature="e#300#1179#0#PHP" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/api/index/controller/SendController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="414">
<caret line="300" column="8" lean-forward="false" selection-start-line="300" selection-start-column="8" selection-end-line="306" selection-end-column="38" />
<folding>
<element signature="e#296#1102#0#PHP" expanded="false" />
<element signature="e#1108#2740#0#PHP" expanded="false" />
<element signature="e#2746#2930#0#PHP" expanded="false" />
<element signature="e#2935#3129#0#PHP" expanded="false" />
<element signature="e#3135#4309#0#PHP" expanded="false" />
<element signature="e#4314#6247#0#PHP" expanded="false" />
<element signature="e#6253#7185#0#PHP" expanded="false" />
<element signature="e#7190#8878#0#PHP" expanded="false" />
<element signature="e#8884#9693#0#PHP" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/api/index/controller/ResourceController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="540">
... ... @@ -652,5 +636,31 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/api/index/controller/SendController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="414">
<caret line="300" column="8" lean-forward="false" selection-start-line="300" selection-start-column="8" selection-end-line="306" selection-end-column="38" />
<folding>
<element signature="e#296#1102#0#PHP" expanded="false" />
<element signature="e#1108#2740#0#PHP" expanded="false" />
<element signature="e#2746#2930#0#PHP" expanded="false" />
<element signature="e#2935#3129#0#PHP" expanded="false" />
<element signature="e#3135#4309#0#PHP" expanded="false" />
<element signature="e#4314#6247#0#PHP" expanded="false" />
<element signature="e#6253#7185#0#PHP" expanded="false" />
<element signature="e#7190#8878#0#PHP" expanded="false" />
<element signature="e#8884#9693#0#PHP" expanded="false" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/api/index/controller/FinanceController.php">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="667">
<caret line="72" column="32" lean-forward="false" selection-start-line="72" selection-start-column="32" selection-end-line="72" selection-end-column="32" />
<folding />
</state>
</provider>
</entry>
</component>
</project>
\ No newline at end of file
... ...
... ... @@ -38,42 +38,46 @@ class FinanceController extends RestBaseController
* @param name:user_tel type:string require:1 desc:手机号码
* @param name:user_wx type:string require:0 desc: 微信号
* @param name:user_email type:string require:1 desc:邮箱
* @param name:status type:int require:1 desc:保存为0 提交为1
* @param name:status type:int require:1 desc:保存为1 提交为2
*
*/
public function index()
{
$user_id = $this->getUserId();
$param = $this->request->param();
$status = $param['status'];
$param['user_id'] = $user_id;
$param['create_time'] = time();
if($param['status'] == 0) {
$data = Db::name('job')
->insert($param);
if (empty($data)) {
$this->error(['code' => 40006, 'msg' => 'sql执行失败']);
}
$this->success('SUCCESS');
}else{
$validate = new Validate([
'company_name' => 'require',
'employing' => 'require',
'money'=>'require|number',
'money_purpose'=>'require',
'work_adress'=>'require',
'user_name'=>'require',
'user_tel'=>'require|number|max:11',
'user_email'=>'require'
]);
if (!$validate->check($param)) {
$this->error(['code'=>40005,'msg'=>$validate->getError()]);
}
$data = Db::name('finance')
->insert($param);
if(empty($data)){
$this->error(['code'=>40006,'msg'=>'sql执行失败']);
}
$this->success('SUCCESS');
}
if($status == 2){
$validate = new Validate([
'company_name' => 'require',
'employing' => 'require',
'money'=>'require|number',
'money_purpose'=>'require',
'work_adress'=>'require',
'user_name'=>'require',
'user_tel'=>'require|number|max:11',
'user_email'=>'require'
]);
if (!$validate->check($param)) {
$this->error(['code'=>40005,'msg'=>$validate->getError()]);
}
$param['status'] = 1;
$data = Db::name('finance')
->insert($param);
if(empty($data)){
$this->error(['code'=>40006,'msg'=>'sql执行失败']);
}
$this->success('SUCCESS');
}else{
$param['status'] = 0;
$data = Db::name('finance')
->insert($param);
if(empty($data)){
$this->error(['code'=>40006,'msg'=>'sql执行失败']);
}
$this->success('SUCCESS');
}
}
}
\ No newline at end of file
... ...