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
683b1641
Commit
683b1641
authored
Sep 17, 2018
by
zhuwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bug
parent
85fad908
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
21 deletions
+32
-21
StatementService.php
application/api_broker/service/StatementService.php
+14
-9
OBargainModel.php
application/model/OBargainModel.php
+9
-10
OMarchInModel.php
application/model/OMarchInModel.php
+9
-2
No files found.
application/api_broker/service/StatementService.php
View file @
683b1641
...
@@ -144,6 +144,7 @@ class StatementService
...
@@ -144,6 +144,7 @@ class StatementService
//dump($conditions);
//dump($conditions);
$result
[
"user_num"
]
=
$this
->
userModel
->
getAddUserNumByAgentId
(
$conditions
);
$result
[
"user_num"
]
=
$this
->
userModel
->
getAddUserNumByAgentId
(
$conditions
);
//dump($conditions);
//dump($conditions);
//本周带看(报备)
$addMarchInNum
=
$this
->
marchInModel
->
getAddMarchInNum
(
$conditions
);
$addMarchInNum
=
$this
->
marchInModel
->
getAddMarchInNum
(
$conditions
);
$result
[
"follow_up_num"
]
=
isset
(
$addMarchInNum
[
0
][
"num"
])
?
$addMarchInNum
[
0
][
"num"
]
:
0
;
$result
[
"follow_up_num"
]
=
isset
(
$addMarchInNum
[
0
][
"num"
])
?
$addMarchInNum
[
0
][
"num"
]
:
0
;
...
@@ -158,8 +159,8 @@ class StatementService
...
@@ -158,8 +159,8 @@ class StatementService
$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, 20'
);
//dump($where_);
$obargain
=
new
OBargainModel
();
$obargain
=
new
OBargainModel
();
$performanceSum
=
$obargain
->
getAddBargainNum
(
$where_
,
1
);
//1表示业绩 2表示实收
$performanceSum
=
$obargain
->
getAddBargainNum
(
$where_
,
1
);
//1表示业绩 2表示实收
...
@@ -167,13 +168,13 @@ class StatementService
...
@@ -167,13 +168,13 @@ class StatementService
//本周业绩
//本周业绩
$start_time
=
date
(
"Y-m-d"
,
strtotime
(
"-7 day"
));
$start_time
=
date
(
"Y-m-d"
,
strtotime
(
"-7 day"
));
$where_
[
'create_time'
]
=
[
'between'
,
[
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
]
];
$where_
[
'create_time'
]
=
$conditions
[
'create_time'
];
$performanceSum
=
$obargain
->
getAddBargainNum
(
$where_
,
1
);
//1表示业绩 2表示实收
$performanceSum
=
$obargain
->
getAddBargainNum
(
$where_
,
1
);
//1表示业绩 2表示实收
$result
[
"performance_week"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
$result
[
"performance_week"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
//本周客源
//本周客源
$start_time
=
date
(
"Y-m-d"
,
strtotime
(
"-7 day"
));
$start_time
=
date
(
"Y-m-d"
,
strtotime
(
"-7 day"
));
$where_
[
'create_time'
]
=
[
'between'
,
[
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
]
];
$where_
[
'create_time'
]
=
$conditions
[
'create_time'
];
$addUserNum
=
$this
->
userModel
->
getAddUserNum
(
$where_
);
$addUserNum
=
$this
->
userModel
->
getAddUserNum
(
$where_
);
$result
[
"add_user_num_week"
]
=
isset
(
$addUserNum
[
0
][
"num"
])
?
$addUserNum
[
0
][
"num"
]
:
0
;
$result
[
"add_user_num_week"
]
=
isset
(
$addUserNum
[
0
][
"num"
])
?
$addUserNum
[
0
][
"num"
]
:
0
;
...
@@ -188,8 +189,10 @@ class StatementService
...
@@ -188,8 +189,10 @@ class StatementService
$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"
)
);
// dump($where_);
$performanceSum
=
$obargain
->
getAddBargainNum
(
$where_
,
3
);
//1表示业绩 2表示实收
$performanceSum
=
$obargain
->
getAddBargainNumV2
(
$where_
,
3
);
//1表示业绩 2表示实收
//dump($where_);exit;
$result
[
"bargain_sum"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
$result
[
"bargain_sum"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
//exit;
//exit;
...
@@ -366,12 +369,14 @@ class StatementService
...
@@ -366,12 +369,14 @@ class StatementService
$store_list
[
"follow_up_num"
]
=
isset
(
$addMarchInNum
[
0
][
"num"
])
?
$addMarchInNum
[
0
][
"num"
]
:
0
;
$store_list
[
"follow_up_num"
]
=
isset
(
$addMarchInNum
[
0
][
"num"
])
?
$addMarchInNum
[
0
][
"num"
]
:
0
;
//本周业绩
//本周业绩
$start_time
=
date
(
"Y-m-d"
,
strtotime
(
"-
7
day"
));
$start_time
=
date
(
"Y-m-d"
,
strtotime
(
"-
6
day"
));
$end_time
=
date
(
"Y-m-d"
,
strtotime
(
"-1 day"
)
);
$end_time
=
date
(
"Y-m-d"
);
$where_
[
"agent_id"
]
=
$agent_id
;
$where_
[
"agent_id"
]
=
$agent_id
;
$where_
[
'create_time'
]
=
[
'between'
,
[
$start_time
.
" 00:00:00"
,
$end_time
.
" 23:59:59"
]
];
$where_
[
'create_time'
]
=
$conditions
[
'create_time'
];
$
obargain
=
new
OBargainModel
(
);
$
where_
[
'status'
]
=
array
(
"in"
,
'10, 11, 13, 20'
);
$obargain
=
new
OBargainModel
();
// dump($where_);
$performanceSum
=
$obargain
->
getAddBargainNum
(
$where_
,
1
);
//1表示业绩 2表示实收
$performanceSum
=
$obargain
->
getAddBargainNum
(
$where_
,
1
);
//1表示业绩 2表示实收
$store_list
[
"performance_week"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
$store_list
[
"performance_week"
]
=
isset
(
$performanceSum
[
0
][
"num"
])
?
$performanceSum
[
0
][
"num"
]
:
0
;
...
...
application/model/OBargainModel.php
View file @
683b1641
...
@@ -712,7 +712,6 @@ class OBargainModel extends Model
...
@@ -712,7 +712,6 @@ class OBargainModel extends Model
array_push
(
$join
,
[
' o_report c'
,
'a.report_id=c.id'
,
'left'
]);
array_push
(
$join
,
[
' o_report c'
,
'a.report_id=c.id'
,
'left'
]);
}
}
if
(
isset
(
$params
[
"agent_id"
]))
{
if
(
isset
(
$params
[
"agent_id"
]))
{
$where_
[
"a.agent_id"
]
=
$params
[
"agent_id"
];
$where_
[
"a.agent_id"
]
=
$params
[
"agent_id"
];
}
}
...
@@ -729,13 +728,18 @@ class OBargainModel extends Model
...
@@ -729,13 +728,18 @@ class OBargainModel extends Model
array_push
(
$join
,
[
' o_order b'
,
'a.order_id = b.id'
,
'left'
]);
array_push
(
$join
,
[
' o_order b'
,
'a.order_id = b.id'
,
'left'
]);
}
}
if
(
isset
(
$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
();
// echo $this->getLastSql();
/*echo $this->getLastSql();
echo '------------------';*/
return
$return
;
return
$return
;
}
}
public
function
getAddBargainNumV2
(
$params
,
$type
)
public
function
getAddBargainNumV2
(
$params
,
$type
)
...
@@ -749,19 +753,14 @@ class OBargainModel extends Model
...
@@ -749,19 +753,14 @@ class OBargainModel extends Model
$field
=
"sum(practical_fee) as num"
;
$field
=
"sum(practical_fee) as num"
;
}
elseif
(
$type
==
3
)
{
}
elseif
(
$type
==
3
)
{
$field
=
"count(1) as num"
;
$field
=
"count(1) as num"
;
//$where_["trade_type"] = 10;//产品要求统计数量必须是出租类型的180620
$where_
[
"role"
]
=
3
;
//必须是反签方
$where_
[
"role"
]
=
3
;
//必须是反签方
array_push
(
$join
,
[
' o_report c'
,
'a.report_id=c.id'
,
'left'
]);
}
}
if
(
isset
(
$params
[
"agent_id"
]))
{
if
(
isset
(
$params
[
"agent_id"
]))
{
$where_
[
"a.agent_id"
]
=
$params
[
"agent_id"
];
$where_
[
"a.agent_id"
]
=
$params
[
"agent_id"
];
}
}
if
(
isset
(
$params
[
"agent_id"
])
&&
$type
==
3
)
{
unset
(
$where_
[
"agent_id"
]);
$where_
[
"c.report_agent_id"
]
=
$params
[
"agent_id"
];
}
if
(
isset
(
$params
[
"create_time"
]))
{
if
(
isset
(
$params
[
"create_time"
]))
{
$where_
[
"a.create_time"
]
=
$params
[
"create_time"
];
$where_
[
"a.create_time"
]
=
$params
[
"create_time"
];
}
}
...
@@ -777,8 +776,7 @@ class OBargainModel extends Model
...
@@ -777,8 +776,7 @@ class OBargainModel extends Model
->
join
(
$join
)
->
join
(
$join
)
->
where
(
$where_
)
->
where
(
$where_
)
->
select
();
->
select
();
// echo $this->getLastSql();
//echo $this->getLastSql();
Log
::
write
(
$this
->
getLastSql
(),
'本月完成单数-7151'
);
//记录日志
return
$return
;
return
$return
;
}
}
/**
/**
...
@@ -1449,6 +1447,7 @@ class OBargainModel extends Model
...
@@ -1449,6 +1447,7 @@ class OBargainModel extends Model
$where_
[
"a.create_time"
]
=
$params
[
"create_time"
];
$where_
[
"a.create_time"
]
=
$params
[
"create_time"
];
}
}
$where_
[
"a.status"
]
=
array
(
"in"
,
"10,11,13,20"
);
$where_
[
"a.status"
]
=
array
(
"in"
,
"10,11,13,20"
);
//$where_["a.role"] = 3;//必须是反签方
$result
=
$this
->
db_
$result
=
$this
->
db_
->
field
(
$field
)
->
field
(
$field
)
->
alias
(
"a"
)
->
alias
(
"a"
)
...
...
application/model/OMarchInModel.php
View file @
683b1641
...
@@ -160,7 +160,8 @@ class OMarchInModel extends Model
...
@@ -160,7 +160,8 @@ class OMarchInModel extends Model
->
join
(
"o_order b"
,
"a.order_id = b.id"
,
"left"
)
->
join
(
"o_order b"
,
"a.order_id = b.id"
,
"left"
)
->
where
(
$where_
)
->
where
(
$where_
)
->
select
();
->
select
();
//dump($this->getLastSql($return));
//echo $this->getLastSql();
//echo '=============';
return
$return
;
return
$return
;
}
}
...
@@ -172,6 +173,9 @@ class OMarchInModel extends Model
...
@@ -172,6 +173,9 @@ class OMarchInModel extends Model
public
function
getMarchInNum
(
$params
)
public
function
getMarchInNum
(
$params
)
{
{
$where_
=
[];
$where_
=
[];
if
(
isset
(
$params
[
"agent_id"
]))
{
$where_
[
"a.reception_id"
]
=
$params
[
"agent_id"
];
}
if
(
isset
(
$params
[
"create_time"
]))
{
if
(
isset
(
$params
[
"create_time"
]))
{
$where_
[
"a.create_time"
]
=
$params
[
"create_time"
];
$where_
[
"a.create_time"
]
=
$params
[
"create_time"
];
}
}
...
@@ -179,13 +183,16 @@ class OMarchInModel extends Model
...
@@ -179,13 +183,16 @@ class OMarchInModel extends Model
$where_
[
"b.house_id"
]
=
$params
[
"house_id"
];
$where_
[
"b.house_id"
]
=
$params
[
"house_id"
];
$where_
[
"b.is_del"
]
=
0
;
//选择正常状态的参数
$where_
[
"b.is_del"
]
=
0
;
//选择正常状态的参数
}
}
return
Db
::
table
(
$this
->
table
)
$return
=
Db
::
table
(
$this
->
table
)
->
field
(
"count(1) as num,a.create_time"
)
->
field
(
"count(1) as num,a.create_time"
)
->
alias
(
"a"
)
->
alias
(
"a"
)
->
join
(
"o_order b"
,
"a.order_id = b.id"
,
"left"
)
->
join
(
"o_order b"
,
"a.order_id = b.id"
,
"left"
)
->
where
(
$where_
)
->
where
(
$where_
)
->
limit
(
1
)
->
limit
(
1
)
->
select
();
->
select
();
// echo $this->getLastSql();
// echo '=============1';
return
$return
;
}
}
/**统计房源进场数据列表
/**统计房源进场数据列表
...
...
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