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
d38d7e11
Commit
d38d7e11
authored
Aug 05, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
收款操作记录
parent
32cb0270
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
104 additions
and
149 deletions
+104
-149
ReceiptOperatingRecords.php
application/index/controller/ReceiptOperatingRecords.php
+65
-0
GReceiptOperatingRecords.php
application/model/GReceiptOperatingRecords.php
+37
-149
route.php
application/route.php
+2
-0
No files found.
application/index/controller/ReceiptOperatingRecords.php
0 → 100644
View file @
d38d7e11
<?php
namespace
app\index\controller
;
use
app\api\service\AccountBalanceService
;
use
app\api_broker\service\RedisCacheService
;
use
app\index\extend\Basic
;
use
app\model\GReceiptOperatingRecords
;
use
think\Request
;
class
ReceiptOperatingRecords
extends
Basic
{
private
$m_receipt_operating_records
;
public
function
__construct
(
Request
$request
=
null
)
{
parent
::
__construct
(
$request
);
$this
->
m_receipt_operating_records
=
new
GReceiptOperatingRecords
();
}
/**
* 收款操作记录
* @return \think\Response
*/
public
function
receiptOperatingRecordsList
()
{
$params
=
$this
->
params
;
/*$params = array(
"office_name" => '鳖'
);*/
$pageNo
=
empty
(
$this
->
params
[
'pageNo'
])
?
1
:
$this
->
params
[
'pageNo'
];
$pageSize
=
empty
(
$this
->
params
[
'pageSize'
])
?
10
:
$this
->
params
[
'pageSize'
];
$conditions
=
[];
if
(
!
empty
(
$params
[
'start_date'
])
&&
!
empty
(
$params
[
'end_date'
]))
{
$conditions
[
'create_time'
]
=
[
'between time'
,
[
$params
[
'start_date'
]
.
' 00:00:00'
,
$params
[
'end_date'
]
.
' 23:59:59'
]];
}
if
(
!
empty
(
$params
[
'house_id'
]))
{
$conditions
[
'house_id'
]
=
$params
[
'house_id'
];
}
$field
=
'id,agents_id,type,remark,house_id,create_time'
;
$result
=
$this
->
m_receipt_operating_records
->
getOperatingList
(
$field
,
$conditions
,
$pageNo
,
$pageSize
);
if
(
!
$result
)
return
$this
->
response
(
"200"
,
"成功"
,
[]);
$redis_cache
=
new
RedisCacheService
();
foreach
(
$result
as
$k
=>
$v
)
{
$agent_data
=
$redis_cache
->
getRedisCache
(
2
,
$v
[
'agents_id'
]);
$result
[
$k
][
'agents_name'
]
=
$agent_data
[
'name'
];
$result
[
$k
][
'agents_phone'
]
=
$agent_data
[
'phone'
];
}
$result_total
=
$this
->
m_receipt_operating_records
->
getOperatingTotal
(
$field
,
$conditions
);
$data
[
'list'
]
=
$result
;
$data
[
'total'
]
=
$result_total
;
return
$this
->
response
(
"200"
,
"成功"
,
$data
);
}
}
\ No newline at end of file
application/model/GReceiptOperatingRecords.php
View file @
d38d7e11
...
...
@@ -17,159 +17,47 @@ class GReceiptOperatingRecords extends Model
$this
->
db_
=
Db
::
name
(
$this
->
table
);
}
// public function save
ReceiptOperatingRecord
($data) {
// public function save
Operating
($data) {
// $time = date("Y-m-d H:i:s", time());
// $data['create_time'] = $time;
// $data['update_time'] = $time;
// $data['is_del'] = 0;
// return $this->db_ ->insert($data);
// }
//
// /**
// * 查询数据
// */
// public function getReceiptOperatingRecord($field,$params)
// {
// $params["a.is_del"] = 0;
// $result = $this->db_
// ->field($field)
// ->alias('a')
// ->join('u_users b', 'a.user_id = b.id', 'left')
// ->join('a_agents c', 'a.agent_id = c.id', 'left')
// ->where($params)
// ->find();
// //echo $this->getLastSql();
// return $result;
// }
//
// /**
// * 查客方
// * @param $field
// * @param $params
// * @return array|false|\PDOStatement|string|Model
// */
// public function getReceiptOperatingRecordId($field,$params)
// {
// $params["is_del"] = 0;
// $result = $this->db_
// ->field($field)
// ->alias('a')
// ->join('a_agents b', 'a.agent_id = b.id', 'left')
// ->where($params)
// ->select();
// //echo $this->getLastSql();
// return $result;
// }
//
// public function selectReceiptOperatingRecord($field,$params)
// {
// $params["a.is_del"] = 0;
// $result = $this->db_
// ->field($field)
// ->alias('a')
// ->join('u_users b', 'a.user_id = b.id', 'left')
// ->join('a_agents c', 'a.agent_id = c.id', 'left')
// ->join('a_site d', 'a.site_id = d.id', 'left')
// ->where($params)
// ->select();
// //echo $this->getLastSql();
// return $result;
// }
//
// public function selectUser($field,$params)
// {
// $params["is_del"] = 0;
// $result = $this->db_
// ->field($field)
// ->where($params)
// ->select();
// //echo $this->getLastSql();
// return $result;
// }
// /**
// * 更新数据
// */
// public function updateReceiptOperatingRecord($where,$params)
// {
// $result = $this->db_ ->where($where)->update($params);
// //dump($this->getLastSql());
// return $result;
//
// }
//
// /**
// * @param $field
// * @param $params
// * @return array
// */
// public function getReceiptOperatingRecordColumn($field, $params) {
// $params['is_del'] = 0;
// return $this->db_->where($params)
// ->column($field);
// }
//
// /**
// * 统计客方
// * @param $params
// * @return false|\PDOStatement|string|\think\Collection
// * @throws \think\db\exception\DataNotFoundException
// * @throws \think\db\exception\ModelNotFoundException
// * @throws \think\exception\DbException
// */
// public function getAddUserNumGroupTimeNew($params)
// {
// $field = "count(1) as num";
// $where_['is_del'] = 0;
// if (isset($params["agent_id"])) {
// $where_["agent_id"] = $params["agent_id"];
// }
// if (isset($params["create_time"])) {
// $where_["create_time"] = $params["create_time"];
// }
// return $this->db_
// ->field($field)
// ->where($where_)
// ->select();
// }
//
// public function moveHouseInsertAll($data)
// {
// $result = Db::table($this->table)
// ->insertAll($data);
// return $result;
// }
//
// /**
// * @param $field
// * @param $where
// * @return false|\PDOStatement|string|\think\Collection
// */
// public function getAllData($field, $where)
// {
// $where['is_del'] = 0;
// return $this->db_->field($field)
// ->where($where)
// ->select();
// }
//
// public function getAddUserList($params, $field, $page_no, $page_size)
// {
// $where_ = [];
// if (isset($params["agent_id"])) {
// $where_["a.agent_id"] = $params["agent_id"];
// }
// if (isset($params["create_time"])) {
// $where_["a.create_time"] = $params["create_time"];
// }
// $result = $this->db_
// ->field($field)
// ->alias('a')
// ->join('u_users b', 'a.user_id = b.id', 'left')
// ->join('a_agents c', 'a.agent_id = c.id', 'left')
// ->where($where_)
// ->limit($page_size)
// ->page($page_no)
// ->select();
// return $result;
// }
/**
*收款操作记录
* @param $field
* @param $params
* @param $pageNo
* @param $pageSize
* @return false|\PDOStatement|string|\think\Collection
*/
public
function
getOperatingList
(
$field
,
$params
,
$pageNo
,
$pageSize
)
{
$result
=
$this
->
db_
->
field
(
$field
)
->
where
(
$params
)
->
limit
(
$pageSize
)
->
page
(
$pageNo
)
->
order
(
'id desc'
)
->
select
();
return
$result
;
}
/**
* 收款操作记录
* @param $field
* @param $params
* @return int|string
*/
public
function
getOperatingTotal
(
$field
,
$params
)
{
$result
=
$this
->
db_
->
field
(
$field
)
->
where
(
$params
)
->
count
();
return
$result
;
}
}
application/route.php
View file @
d38d7e11
...
...
@@ -567,6 +567,8 @@ Route::group('index', [
'editCompanyData'
=>
[
'index/CostParameter/editCompanyData'
,
[
'method'
=>
'POST|GET'
]],
'editDiscounts'
=>
[
'index/CostParameter/editDiscounts'
,
[
'method'
=>
'POST|GET'
]],
'receiptOperatingRecordsList'
=>
[
'index/ReceiptOperatingRecords/receiptOperatingRecordsList'
,
[
'method'
=>
'POST|GET'
]],
]);
...
...
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