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
b55785a3
Commit
b55785a3
authored
Apr 12, 2019
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
d5a7b406
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
21 deletions
+13
-21
Statement.php
application/api_broker/controller/Statement.php
+2
-11
StatementService.php
application/api_broker/service/StatementService.php
+8
-8
OBargainModel.php
application/model/OBargainModel.php
+2
-1
OPayLogModel.php
application/model/OPayLogModel.php
+1
-1
No files found.
application/api_broker/controller/Statement.php
View file @
b55785a3
...
@@ -38,17 +38,8 @@ class Statement extends Basic
...
@@ -38,17 +38,8 @@ class Statement extends Basic
header
(
'Access-Control-Allow-Origin:*'
);
header
(
'Access-Control-Allow-Origin:*'
);
$params
=
$this
->
params
;
$params
=
$this
->
params
;
Log
::
write
(
$params
,
'zhuwei'
);
//记录日志
// big_log('日报周报获取新增数据-dayStatement');
/*$params = array(
// big_log(json_encode($params));
"agent_id" => 3742,//5739 总监 5740店长
"time_start" => date("Y-m-d", time()),
"time_end" => date("Y-m-d", time()),
);*/
/*$params = array (
'agent_id' => '5739',
'time_start' => '2018-11-23',
'time_end' => '2018-11-23',
);*/
if
(
!
isset
(
$params
[
"agent_id"
])
||
!
isset
(
$params
[
"time_start"
])
||
!
isset
(
$params
[
"time_end"
]))
{
if
(
!
isset
(
$params
[
"agent_id"
])
||
!
isset
(
$params
[
"time_start"
])
||
!
isset
(
$params
[
"time_end"
]))
{
return
$this
->
response
(
"101"
,
"请求参数错误"
);
return
$this
->
response
(
"101"
,
"请求参数错误"
);
...
...
application/api_broker/service/StatementService.php
View file @
b55785a3
...
@@ -265,7 +265,8 @@ class StatementService
...
@@ -265,7 +265,8 @@ class StatementService
//$where_["district_id"] = $district_id;
//$where_["district_id"] = $district_id;
$where_
[
"agent_id"
]
=
$conditions
[
"agent_id"
];
$where_
[
"agent_id"
]
=
$conditions
[
"agent_id"
];
$where_
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
)
);
$where_
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
)
);
// $obargain = new OBargainModel();
$where_
[
'status'
]
=
array
(
"in"
,
'10, 11, 13'
);
$performanceSum
=
$this
->
bargainModel
->
getAddBargainNum
(
$where_
,
1
);
//1表示业绩 2表示实收
$performanceSum
=
$this
->
bargainModel
->
getAddBargainNum
(
$where_
,
1
);
//1表示业绩 2表示实收
$result
[
"director_performance_month"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
$result
[
"director_performance_month"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
...
@@ -286,11 +287,9 @@ class StatementService
...
@@ -286,11 +287,9 @@ class StatementService
$where_
=
[];
$where_
=
[];
$start_time
=
date
(
"Y-m-01"
,
time
());
$start_time
=
date
(
"Y-m-01"
,
time
());
$end_time
=
date
(
"Y-m-d"
,
time
());
$end_time
=
date
(
"Y-m-d"
,
time
());
// $where_["district_id"] = $district_id;
$where_
[
"agent_id"
]
=
$conditions
[
"agent_id"
];
$where_
[
"agent_id"
]
=
$conditions
[
"agent_id"
];
$where_
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
)
);
$where_
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
)
);
// $obargain = new OBargainModel(
);
$where_
[
'status'
]
=
array
(
"in"
,
'10, 11, 13'
);
$performanceSum
=
$this
->
bargainModel
->
getAddBargainNum
(
$where_
,
1
);
//1表示业绩 2表示实收
$performanceSum
=
$this
->
bargainModel
->
getAddBargainNum
(
$where_
,
1
);
//1表示业绩 2表示实收
$result
[
"director_performance_month"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
$result
[
"director_performance_month"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
...
@@ -298,10 +297,9 @@ class StatementService
...
@@ -298,10 +297,9 @@ class StatementService
$where_
=
[];
$where_
=
[];
$start_time
=
date
(
"Y-m-d"
,
strtotime
(
"-13 day"
));
$start_time
=
date
(
"Y-m-d"
,
strtotime
(
"-13 day"
));
$end_time
=
date
(
"Y-m-d"
,
strtotime
(
"-7 day"
));
$end_time
=
date
(
"Y-m-d"
,
strtotime
(
"-7 day"
));
// $where_["district_id"] = $district_id;
$where_
[
"agent_id"
]
=
$conditions
[
"agent_id"
];
$where_
[
"agent_id"
]
=
$conditions
[
"agent_id"
];
$where_
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
)
);
$where_
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
)
);
// $obargain = new OBargainModel(
);
$where_
[
'status'
]
=
array
(
"in"
,
'10, 11, 13'
);
$performanceSum
=
$this
->
bargainModel
->
getAddBargainNum
(
$where_
,
1
);
//1表示业绩 2表示实收
$performanceSum
=
$this
->
bargainModel
->
getAddBargainNum
(
$where_
,
1
);
//1表示业绩 2表示实收
$result
[
"director_last_week_performance_num"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
$result
[
"director_last_week_performance_num"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
...
@@ -310,10 +308,9 @@ class StatementService
...
@@ -310,10 +308,9 @@ class StatementService
$where_
=
[];
$where_
=
[];
$start_time
=
date
(
"Y-m-d"
,
strtotime
(
"-7 day"
));
$start_time
=
date
(
"Y-m-d"
,
strtotime
(
"-7 day"
));
$end_time
=
date
(
"Y-m-d"
,
time
());
$end_time
=
date
(
"Y-m-d"
,
time
());
// $where_["district_id"] = $district_id;
$where_
[
"agent_id"
]
=
$conditions
[
"agent_id"
];
$where_
[
"agent_id"
]
=
$conditions
[
"agent_id"
];
$where_
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
)
);
$where_
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
)
);
// $obargain = new OBargainModel(
);
$where_
[
'status'
]
=
array
(
"in"
,
'10, 11, 13'
);
$performanceSum
=
$this
->
bargainModel
->
getAddBargainNum
(
$where_
,
1
);
//1表示业绩 2表示实收
$performanceSum
=
$this
->
bargainModel
->
getAddBargainNum
(
$where_
,
1
);
//1表示业绩 2表示实收
$result
[
"director_week_performance_num"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
$result
[
"director_week_performance_num"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
...
@@ -488,6 +485,7 @@ class StatementService
...
@@ -488,6 +485,7 @@ class StatementService
$end_time
=
date
(
"Y-m-d"
,
time
());
$end_time
=
date
(
"Y-m-d"
,
time
());
$where_
[
"agent_id"
]
=
array
(
"in"
,
$agentIds
);
$where_
[
"agent_id"
]
=
array
(
"in"
,
$agentIds
);
$where_
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
)
);
$where_
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
)
);
$where_
[
'status'
]
=
array
(
"in"
,
'10, 11, 13'
);
$obargain
=
new
OBargainModel
();
$obargain
=
new
OBargainModel
();
//dump($where_);
//dump($where_);
...
@@ -507,6 +505,8 @@ class StatementService
...
@@ -507,6 +505,8 @@ class StatementService
$end_time
=
date
(
"Y-m-d"
,
time
());
$end_time
=
date
(
"Y-m-d"
,
time
());
$where_
[
"agent_id"
]
=
array
(
"in"
,
$agentIds
);
$where_
[
"agent_id"
]
=
array
(
"in"
,
$agentIds
);
$where_
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
)
);
$where_
[
'create_time'
]
=
array
(
'between'
,
array
(
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
)
);
$where_
[
'status'
]
=
array
(
"in"
,
'10, 11, 13'
);
$performanceSum
=
$obargain
->
getAddBargainNum
(
$where_
,
1
);
//1表示业绩 2表示实收
$performanceSum
=
$obargain
->
getAddBargainNum
(
$where_
,
1
);
//1表示业绩 2表示实收
$results
[
$key
][
"director_week_performance_num"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
$results
[
$key
][
"director_week_performance_num"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
// 本月业绩
// 本月业绩
...
...
application/model/OBargainModel.php
View file @
b55785a3
...
@@ -780,13 +780,14 @@ class OBargainModel extends Model
...
@@ -780,13 +780,14 @@ class OBargainModel extends Model
$where_
[
"a.status"
]
=
$params
[
"status"
];
$where_
[
"a.status"
]
=
$params
[
"status"
];
}
}
$return
=
Db
::
table
(
$this
->
table
)
$return
=
Db
::
table
(
$this
->
table
)
->
field
(
$field
)
->
field
(
$field
)
->
alias
(
"a"
)
->
alias
(
"a"
)
->
join
(
$join
)
->
join
(
$join
)
->
where
(
$where_
)
->
where
(
$where_
)
->
select
();
->
select
();
big_log
(
$this
->
getLastSql
());
//
big_log($this->getLastSql());
return
$return
;
return
$return
;
}
}
public
function
getAddBargainNumV2
(
$params
,
$type
)
public
function
getAddBargainNumV2
(
$params
,
$type
)
...
...
application/model/OPayLogModel.php
View file @
b55785a3
...
@@ -399,7 +399,7 @@ class OPayLogModel extends Model
...
@@ -399,7 +399,7 @@ class OPayLogModel extends Model
->
sum
(
$field
);
->
sum
(
$field
);
}
}
big_log
(
$this
->
getLastSql
());
//
big_log($this->getLastSql());
return
$data
;
return
$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