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
42834ad0
Commit
42834ad0
authored
Jan 16, 2019
by
zw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tup
parent
ce7f72d7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
200 additions
and
0 deletions
+200
-0
DailyPaper.php
application/api_broker/controller/DailyPaper.php
+193
-0
route.php
application/route.php
+7
-0
No files found.
application/api_broker/controller/DailyPaper.php
0 → 100644
View file @
42834ad0
<?php
namespace
app\api_broker\controller
;
use
app\api_broker\extend\Basic
;
use
app\api_broker\service\DailyPaperService
;
use
think\Request
;
/**
* Created by PhpStorm.
* User : zw
* Date : 2018/12/17
* Time : 11:09 AM
* Intro:
*/
class
DailyPaper
extends
Basic
{
private
$service_
;
public
function
__construct
(
Request
$request
=
null
)
{
parent
::
__construct
(
$request
);
$this
->
service_
=
new
DailyPaperService
();
}
/**
* 财务日报
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
dailyDetail
()
{
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
/* $params = array(
"store_id" => 730,//门店id
"is_store" => 0,//身份是否是店长,财务显示不一样 0店长 1财务
"daily_data" => "2018-12-18"
);
$this->userId = 5775;*/
if
(
!
isset
(
$params
[
"store_id"
])
||
!
isset
(
$params
[
"is_store"
])
||
!
isset
(
$params
[
"daily_data"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
$store_id
=
$params
[
"store_id"
];
$is_store
=
$params
[
"is_store"
];
$daily_data
=
$params
[
"daily_data"
];
$result
=
$this
->
service_
->
getDaily
(
$this
->
agentId
,
$store_id
,
$is_store
,
$daily_data
);
if
(
$result
[
"code"
]
==
101
)
{
return
$this
->
response
(
"101"
,
$result
[
"msg"
]);
}
else
{
return
$this
->
response
(
"200"
,
"success"
,
$result
[
"data"
]);
}
}
/**
* 店长提交财务日报
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
addDaily
()
{
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
/* $params = array(
"agent_id" => 5775,//经纪人id
"agent_name" => "222",//经纪人姓名
"daily_date" => "2018-12-02",//日报日期
"alipay" => "12",//支付宝收款
"tenpay" => "2323",//微信收款
"realty_pay" => "232",//地产转帐
"family_pay" => "444",//世家公账
"private_bank" => "55",//3000账号
"cash" => "666",//现金
"pos" => "777",//pos机
"other_bank" => "888"//其他
);*/
if
(
empty
(
$params
[
"agent_id"
])
||
empty
(
$params
[
"agent_name"
])
||
empty
(
$params
[
"daily_date"
])
||
!
isset
(
$params
[
"alipay"
])
||
!
isset
(
$params
[
"tenpay"
])
||
!
isset
(
$params
[
"realty_pay"
])
||
!
isset
(
$params
[
"family_pay"
])
||
!
isset
(
$params
[
"private_bank"
])
||
!
isset
(
$params
[
"cash"
])
||
!
isset
(
$params
[
"pos"
])
||
!
isset
(
$params
[
"other_bank"
])
)
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
$agent_id
=
$params
[
"agent_id"
];
$agent_name
=
$params
[
"agent_name"
];
$daily_date
=
$params
[
"daily_date"
];
$alipay
=
$params
[
"alipay"
];
$tenpay
=
$params
[
"tenpay"
];
$realty_pay
=
$params
[
"realty_pay"
];
$private_bank
=
$params
[
"private_bank"
];
$family_pay
=
$params
[
"family_pay"
];
$cash
=
$params
[
"cash"
];
$pos
=
$params
[
"pos"
];
$other_bank
=
$params
[
"other_bank"
];
$result
=
$this
->
service_
->
addDaily
(
$agent_id
,
$agent_name
,
$daily_date
,
$alipay
,
$tenpay
,
$realty_pay
,
$family_pay
,
$private_bank
,
$cash
,
$pos
,
$other_bank
);
if
(
$result
[
"code"
]
==
101
)
{
return
$this
->
response
(
"101"
,
$result
[
"msg"
]);
}
else
{
return
$this
->
response
(
"200"
,
"success"
,
$result
[
"data"
]);
}
}
/**
* 财务审核新增
* @return \think\Response
* @throws \think\db\exception\DataNotFoundException
* @throws \think\db\exception\ModelNotFoundException
* @throws \think\exception\DbException
*/
public
function
commitCheck
(){
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
/*$params = array(
"daily_id" => 1,//日报id
"agent_id" => 5775,//经纪人id
"agent_name" => "222",//经纪人姓名
"alipay" => "12",//支付宝收款
"tenpay" => "2323",//微信收款
"realty_pay" => "232",//地产转帐
"family_pay" => "444",//世家公账
"private_bank" => "55",//3000账号
"cash" => "666",//现金
"pos" => "777",//pos机
"other_bank" => "888",//其他,
"operation_status" => 1,//0审核通过 1转为已审核
"remark" => "888"//备注,
);*/
if
(
!
isset
(
$params
[
"daily_id"
])
||
empty
(
$params
[
"agent_id"
])
||
empty
(
$params
[
"agent_name"
])
||
!
isset
(
$params
[
"alipay"
])
||
!
isset
(
$params
[
"tenpay"
])
||
!
isset
(
$params
[
"realty_pay"
])
||
!
isset
(
$params
[
"family_pay"
])
||
!
isset
(
$params
[
"private_bank"
])
||
!
isset
(
$params
[
"cash"
])
||
!
isset
(
$params
[
"pos"
])
||
!
isset
(
$params
[
"other_bank"
])
||
!
isset
(
$params
[
"operation_status"
])
)
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
$daily_id
=
$params
[
"daily_id"
];
$agent_id
=
$params
[
"agent_id"
];
$agent_name
=
$params
[
"agent_name"
];
$alipay
=
$params
[
"alipay"
];
$tenpay
=
$params
[
"tenpay"
];
$realty_pay
=
$params
[
"realty_pay"
];
$private_bank
=
$params
[
"private_bank"
];
$family_pay
=
$params
[
"family_pay"
];
$cash
=
$params
[
"cash"
];
$pos
=
$params
[
"pos"
];
$other_bank
=
$params
[
"other_bank"
];
$remark
=
$params
[
"remark"
];
$operation_status
=
$params
[
"operation_status"
];
if
(
$operation_status
!=
0
&&
$operation_status
!=
1
){
return
$this
->
response
(
"101"
,
"审核状态错误"
);
}
$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
);
if
(
$result
[
"code"
]
==
101
)
{
return
$this
->
response
(
"101"
,
$result
[
"msg"
]);
}
else
{
return
$this
->
response
(
"200"
,
"success"
,
$result
[
"data"
]);
}
}
/**
* @return \think\Response
*/
public
function
getPayLogImg
(){
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
/* $params = array(
"pay_log_id" => 1
);*/
if
(
!
isset
(
$params
[
"pay_log_id"
])){
return
$this
->
response
(
"101"
,
"请求参数错误"
);
}
$img_list
=
$this
->
service_
->
getImgs
(
$params
[
"pay_log_id"
]);
if
(
count
(
$img_list
)
>
0
){
$result
[
"img_path"
]
=
CHAT_IMG_URL
;
$result
[
"img_info"
]
=
$img_list
;
return
$this
->
response
(
"200"
,
"success"
,
$result
);
}
else
{
return
$this
->
response
(
"200"
,
"request null"
);
}
}
}
\ No newline at end of file
application/route.php
View file @
42834ad0
...
...
@@ -774,6 +774,12 @@ Route::group('broker', [
'addUserBind'
=>
[
'api_broker/User/addUserBind'
,
[
'method'
=>
'get|post'
]
],
'removeUserBind'
=>
[
'api_broker/User/removeUserBind'
,
[
'method'
=>
'get|post'
]
],
'dailyDetail'
=>
[
'api_broker/DailyPaper/dailyDetail'
,
[
'method'
=>
'get|post'
]],
'addDaily'
=>
[
'api_broker/DailyPaper/addDaily'
,
[
'method'
=>
'get|post'
]],
'commitCheck'
=>
[
'api_broker/DailyPaper/commitCheck'
,
[
'method'
=>
'get|post'
]],
'getPayLogImg'
=>
[
'api_broker/DailyPaper/getPayLogImg'
,
[
'method'
=>
'get|post'
]],
]);
//Route::miss('api/index/miss');//处理错误的url
\ No newline at end of file
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