Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tl_estate
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
hujun
tl_estate
Commits
c2c28489
Commit
c2c28489
authored
Sep 02, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
新增罚款
parent
c40cad9a
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
41 additions
and
11 deletions
+41
-11
Amercement.php
application/api_broker/controller/Amercement.php
+11
-9
AmercementService.php
application/index/service/AmercementService.php
+26
-0
OAmercementImgModel.php
application/model/OAmercementImgModel.php
+3
-1
OAmercementModel.php
application/model/OAmercementModel.php
+1
-1
No files found.
application/api_broker/controller/Amercement.php
View file @
c2c28489
...
...
@@ -29,15 +29,17 @@ class Amercement extends Basic
public
function
addAmercement
(){
$params
=
$this
->
params
;
/* $params = array(
"type" => 1,
"money" => 200,
"agent_id" => 5776,
"remarks" => '罚你不需要理由',
);*/
$res
=
$this
->
s_amercement
->
addAmercement
(
$params
,
$this
->
agentId
);
//int(1)
if
(
$res
)
{
/* $params = array(
"type" => 1,
"money" => 200,
"agent_id" => 5776,
"remarks" => '罚你不需要理由',
"img" => '["20190902\\/20190902161242125.jpg","20190902\\/201909021612421258499.jpg"]',
);*/
$father_id
=
$this
->
s_amercement
->
addAmercement
(
$params
,
$this
->
agentId
);
//int(1)
if
(
$father_id
)
{
$this
->
s_amercement
->
addAmercementImg
(
$params
[
'img'
],
$father_id
);
return
$this
->
response
(
"200"
,
"成功"
);
}
else
{
return
$this
->
response
(
"101"
,
"失败"
);
...
...
application/index/service/AmercementService.php
View file @
c2c28489
...
...
@@ -10,15 +10,18 @@
namespace
app\index\service
;
use
app\model\OAmercementImgModel
;
use
app\model\OAmercementModel
;
class
AmercementService
{
protected
$m_amercement
;
protected
$m_amercement_img
;
public
function
__construct
()
{
$this
->
m_amercement
=
new
OAmercementModel
();
$this
->
m_amercement_img
=
new
OAmercementImgModel
();
}
/**
...
...
@@ -38,6 +41,28 @@ class AmercementService
return
$res
;
}
/**
* 上传图片
* @param $img_info
* @param $father_id
* @return bool
*/
public
function
addAmercementImg
(
$img_info
,
$father_id
){
if
(
!
$img_info
)
return
false
;
$sublet_img
=
json_decode
(
$img_info
,
true
);
if
(
!
$sublet_img
)
return
false
;
foreach
(
$sublet_img
as
$k
=>
$v
){
$insert
=
[];
$insert
[
"file_name"
]
=
$v
;
$insert
[
"amercement_id"
]
=
$father_id
;
$this
->
m_amercement_img
->
saveAmercementImg
(
$insert
);
}
return
true
;
}
}
\ No newline at end of file
application/model/OAmercementImgModel.php
View file @
c2c28489
...
...
@@ -21,8 +21,10 @@ class OAmercementImgModel extends Model
$time
=
date
(
"Y-m-d H:i:s"
,
time
());
$data
[
'create_time'
]
=
$time
;
$data
[
'update_time'
]
=
$time
;
$data
[
'
is_del
'
]
=
0
;
$data
[
'
status
'
]
=
0
;
return
$this
->
db_
->
insert
(
$data
);
}
}
application/model/OAmercementModel.php
View file @
c2c28489
...
...
@@ -22,7 +22,7 @@ class OAmercementModel extends Model
$data
[
'create_time'
]
=
$time
;
$data
[
'update_time'
]
=
$time
;
$data
[
'is_del'
]
=
0
;
return
$this
->
db_
->
insert
(
$data
);
return
$this
->
db_
->
insert
GetId
(
$data
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment