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
fe024367
Commit
fe024367
authored
Apr 29, 2019
by
clone
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1
parent
928a3d19
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
69 additions
and
14 deletions
+69
-14
DailyPaper.php
application/index/controller/DailyPaper.php
+66
-14
ODailyLog.php
application/model/ODailyLog.php
+3
-0
No files found.
application/index/controller/DailyPaper.php
View file @
fe024367
...
@@ -5,6 +5,7 @@ namespace app\index\controller;
...
@@ -5,6 +5,7 @@ namespace app\index\controller;
use
app\index\extend\Basic
;
use
app\index\extend\Basic
;
use
app\api_broker\service\DailyPaperService
;
use
app\api_broker\service\DailyPaperService
;
use
app\model\ODaily
;
use
app\model\ODaily
;
use
app\model\ODailyLog
;
use
think\Request
;
use
think\Request
;
/**
/**
...
@@ -111,8 +112,8 @@ class DailyPaper extends Basic
...
@@ -111,8 +112,8 @@ class DailyPaper extends Basic
$bank_card_new
=
$params
[
"bank_card_new"
]
?
$params
[
"bank_card_new"
]
:
0
;
$bank_card_new
=
$params
[
"bank_card_new"
]
?
$params
[
"bank_card_new"
]
:
0
;
$site_id
=
$this
->
siteId
;
$site_id
=
$this
->
siteId
;
$result
=
$this
->
service_
->
addDaily
(
$agent_id
,
$agent_name
,
$daily_date
,
$alipay
,
$tenpay
,
$realty_pay
,
$result
=
$this
->
service_
->
addDaily
(
$agent_id
,
$agent_name
,
$daily_date
,
$alipay
,
$tenpay
,
$realty_pay
,
$family_pay
,
$private_bank
,
$cash
,
$pos
,
$other_bank
,
$tenpay_2
,
$alipay_2
,
$site_id
,
$bank_card
,
$bank_card_yun
$family_pay
,
$private_bank
,
$cash
,
$pos
,
$other_bank
,
$tenpay_2
,
$alipay_2
,
$site_id
,
$bank_card
,
$bank_card_yun
,
$bank_card_lin
,
$bank_card_new
);
,
$bank_card_lin
,
$bank_card_new
);
if
(
$result
[
"code"
]
==
101
)
{
if
(
$result
[
"code"
]
==
101
)
{
return
$this
->
response
(
"101"
,
$result
[
"msg"
]);
return
$this
->
response
(
"101"
,
$result
[
"msg"
]);
}
else
{
}
else
{
...
@@ -127,7 +128,8 @@ class DailyPaper extends Basic
...
@@ -127,7 +128,8 @@ class DailyPaper extends Basic
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
* @throws \think\exception\DbException
*/
*/
public
function
commitCheck
(){
public
function
commitCheck
()
{
header
(
'Access-Control-Allow-Origin:*'
);
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
$params
=
$this
->
params
;
/*$params = array(
/*$params = array(
...
@@ -149,7 +151,7 @@ class DailyPaper extends Basic
...
@@ -149,7 +151,7 @@ class DailyPaper extends Basic
"bank_card_new"=>"123123"
"bank_card_new"=>"123123"
);*/
);*/
$m_daily
=
new
ODaily
();
$m_daily
=
new
ODaily
();
$daily_data
=
$m_daily
->
getDailyList
(
'id,site_id'
,
[
'id'
=>
$params
[
'daily_id'
]],
1
,
1
);
$daily_data
=
$m_daily
->
getDailyList
(
'id,site_id'
,
[
'id'
=>
$params
[
'daily_id'
]],
1
,
1
);
if
(
empty
(
$daily_data
))
{
if
(
empty
(
$daily_data
))
{
return
$this
->
response
(
101
,
'没有该记录,审核失败'
);
return
$this
->
response
(
101
,
'没有该记录,审核失败'
);
...
@@ -182,12 +184,12 @@ class DailyPaper extends Basic
...
@@ -182,12 +184,12 @@ class DailyPaper extends Basic
$bank_card_yun
=
$params
[
"bank_card_yun"
]
?
$params
[
"bank_card_yun"
]
:
0
;
$bank_card_yun
=
$params
[
"bank_card_yun"
]
?
$params
[
"bank_card_yun"
]
:
0
;
$bank_card_lin
=
$params
[
"bank_card_lin"
]
?
$params
[
"bank_card_lin"
]
:
0
;
$bank_card_lin
=
$params
[
"bank_card_lin"
]
?
$params
[
"bank_card_lin"
]
:
0
;
$bank_card_new
=
$params
[
"bank_card_new"
]
?
$params
[
"bank_card_new"
]
:
0
;
$bank_card_new
=
$params
[
"bank_card_new"
]
?
$params
[
"bank_card_new"
]
:
0
;
if
(
$operation_status
!=
0
&&
$operation_status
!=
1
)
{
if
(
$operation_status
!=
0
&&
$operation_status
!=
1
)
{
return
$this
->
response
(
"101"
,
"审核状态错误"
);
return
$this
->
response
(
"101"
,
"审核状态错误"
);
}
}
$result
=
$this
->
service_
->
addDailyCheck
(
$daily_id
,
$agent_id
,
$agent_name
,
$alipay
,
$tenpay
,
$realty_pay
,
$result
=
$this
->
service_
->
addDailyCheck
(
$daily_id
,
$agent_id
,
$agent_name
,
$alipay
,
$tenpay
,
$realty_pay
,
$family_pay
,
$private_bank
,
$cash
,
$pos
,
$other_bank
,
$remark
,
$operation_status
,
$tenpay_2
,
$alipay_2
,
$bank_card
,
$family_pay
,
$private_bank
,
$cash
,
$pos
,
$other_bank
,
$remark
,
$operation_status
,
$tenpay_2
,
$alipay_2
,
$bank_card
,
$bank_card_yun
,
$bank_card_lin
,
$bank_card_new
);
$bank_card_yun
,
$bank_card_lin
,
$bank_card_new
);
if
(
$result
[
"code"
]
==
101
)
{
if
(
$result
[
"code"
]
==
101
)
{
return
$this
->
response
(
"101"
,
$result
[
"msg"
]);
return
$this
->
response
(
"101"
,
$result
[
"msg"
]);
}
else
{
}
else
{
...
@@ -199,24 +201,73 @@ class DailyPaper extends Basic
...
@@ -199,24 +201,73 @@ class DailyPaper extends Basic
/**
/**
* @return \think\Response
* @return \think\Response
*/
*/
public
function
getPayLogImg
(){
public
function
getPayLogImg
()
{
header
(
'Access-Control-Allow-Origin:*'
);
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
$params
=
$this
->
params
;
/* $params = array(
/* $params = array(
"pay_log_id" => 1
"pay_log_id" => 1
);*/
);*/
if
(
!
isset
(
$params
[
"pay_log_id"
]))
{
if
(
!
isset
(
$params
[
"pay_log_id"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
}
$img_list
=
$this
->
service_
->
getImgs
(
$params
[
"pay_log_id"
]);
$img_list
=
$this
->
service_
->
getImgs
(
$params
[
"pay_log_id"
]);
if
(
count
(
$img_list
)
>
0
)
{
if
(
count
(
$img_list
)
>
0
)
{
$result
[
"img_path"
]
=
CHAT_IMG_URL
;
$result
[
"img_path"
]
=
CHAT_IMG_URL
;
$result
[
"img_info"
]
=
$img_list
;
$result
[
"img_info"
]
=
$img_list
;
return
$this
->
response
(
"200"
,
"success"
,
$result
);
return
$this
->
response
(
"200"
,
"success"
,
$result
);
}
else
{
}
else
{
return
$this
->
response
(
"200"
,
"request null"
);
return
$this
->
response
(
"200"
,
"request null"
);
}
}
/**
* 转为已审核的日报备份为图片
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
dailyBackImg
()
{
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
if
(
empty
(
$params
[
"daily_id"
])
||
empty
(
$params
[
"img"
]))
{
return
$this
->
response
(
"101"
,
"参数错误"
);
}
$daily_id
=
$params
[
'daily_id'
];
$m_daily
=
new
ODailyLog
();
$where_
[
"daily_id"
]
=
$daily_id
;
$where_
[
"operation_status"
]
=
1
;
$where_
[
"is_del"
]
=
0
;
$daily_log_data
=
$m_daily
->
getDailyLogList
(
'id'
,
$where_
,
1
,
1
);
if
(
count
(
$daily_log_data
)
<=
0
)
{
return
$this
->
response
(
"101"
,
"只有转为已审核的日报才能备份"
);
}
}
$img_title
=
$img
=
""
;
$base64_image_content
=
$this
->
params
[
"img"
];
if
(
preg_match
(
'/^(data:\s*image\/(\w+);base64,)/'
,
$base64_image_content
,
$array
))
{
$img_title
=
$array
[
2
];
//jpeg
$img
=
base64_decode
(
str_replace
(
$array
[
1
],
''
,
$base64_image_content
));
//返回文件流
}
$tmp_file
=
time
();
$img_name
=
md5
(
uniqid
(
$tmp_file
))
.
'.'
.
$img_title
;
$url
=
'static/week_work_img/'
.
$img_name
;
$img_url
=
""
;
if
(
file_put_contents
(
$url
,
$img
))
{
$img_url
=
IMAGES_URL
.
$url
;
$m_daily
=
new
ODaily
();
$m_daily
->
updateDaily
([
"id"
=>
$daily_id
],[
"back_img"
=>
$img_url
]);
}
else
{
return
$this
->
response
(
"101"
,
"生成图片失败"
);
}
return
$this
->
response
(
"200"
,
"success"
,
[
'img_url'
=>
$img_url
]);
}
}
}
}
\ No newline at end of file
application/model/ODailyLog.php
View file @
fe024367
...
@@ -41,6 +41,9 @@ class ODailyLog extends BaseModel
...
@@ -41,6 +41,9 @@ class ODailyLog extends BaseModel
if
(
isset
(
$params
[
"operation_id"
])){
if
(
isset
(
$params
[
"operation_id"
])){
$where_
[
"operation_id"
]
=
$params
[
"operation_id"
];
$where_
[
"operation_id"
]
=
$params
[
"operation_id"
];
}
}
if
(
isset
(
$params
[
"operation_status"
])){
$where_
[
"operation_status"
]
=
$params
[
"operation_status"
];
}
if
(
isset
(
$params
[
"is_del"
])){
if
(
isset
(
$params
[
"is_del"
])){
$where_
[
"is_del"
]
=
$params
[
"is_del"
];
$where_
[
"is_del"
]
=
$params
[
"is_del"
];
}
}
...
...
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