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
83bc5cc7
Commit
83bc5cc7
authored
Apr 02, 2018
by
clone
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'test-hujun1.15' into test
parents
93be1855
951921a4
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
88 additions
and
72 deletions
+88
-72
StatementService.php
application/api_broker/service/StatementService.php
+28
-26
Version.php
application/index/controller/Version.php
+1
-1
index.html
application/index/view/version/index.html
+15
-3
AppVersion.php
application/model/AppVersion.php
+1
-1
version.js
public/resource/js/version.js
+43
-41
No files found.
application/api_broker/service/StatementService.php
View file @
83bc5cc7
...
@@ -97,18 +97,18 @@ class StatementService
...
@@ -97,18 +97,18 @@ class StatementService
if
(
$agent_total
>
0
)
{
if
(
$agent_total
>
0
)
{
$agentIds
=
""
;
$agentIds
=
""
;
foreach
(
$agentsArr
as
$key
=>
$value
)
{
foreach
(
$agentsArr
as
$key
=>
$value
)
{
$agentIds
.=
$value
[
"id"
]
.
","
;
$agentIds
.=
$value
[
"id"
]
.
","
;
if
(
$user_type
==
1
)
{
if
(
$user_type
==
1
)
{
$store_list
=
$this
->
getStoreList
(
$conditions
,
$value
[
"id"
],
$value
[
"name"
],
$key
);
array_push
(
$store_list
,
$this
->
getStoreList
(
$conditions
,
$value
[
"id"
],
$value
[
"name"
])
);
}
}
}
}
$agentIds
=
rtrim
(
$agentIds
,
","
);
$agentIds
=
rtrim
(
$agentIds
,
","
);
$conditions
[
"agent_id"
]
=
array
(
"in"
,
$agentIds
);
$conditions
[
"agent_id"
]
=
array
(
"in"
,
$agentIds
);
if
(
$user_type
==
2
)
{
if
(
$user_type
==
2
)
{
$district_lists
=
$this
->
getDistrictList
(
$conditions
,
$district_id
);
$district_lists
=
$this
->
getDistrictList
(
$conditions
,
$district_id
);
$district_list
=
$district_lists
[
"district_list"
];
$district_list
=
$district_lists
[
"district_list"
];
$result
[
"last_week_total"
]
=
$district_lists
[
"last_week_total"
];
$result
[
"last_week_total"
]
=
$district_lists
[
"last_week_total"
];
}
}
}
}
}
}
...
@@ -126,20 +126,22 @@ class StatementService
...
@@ -126,20 +126,22 @@ class StatementService
}
}
private
function
getStoreList
(
$conditions
,
$agent_id
,
$agent_name
,
$key
){
private
function
getStoreList
(
$conditions
,
$agent_id
,
$agent_name
)
{
$conditions_
=
$conditions
;
$conditions_
=
$conditions
;
$conditions_
[
"agent_id"
]
=
$agent_id
;
$conditions_
[
"agent_id"
]
=
$agent_id
;
//是门店 统计个人业绩
//是门店 统计个人业绩
$store_list
[
$key
]
[
"agent_id"
]
=
$agent_id
;
$store_list
[
"agent_id"
]
=
$agent_id
;
$store_list
[
$key
]
[
"agent_name"
]
=
$agent_name
;
$store_list
[
"agent_name"
]
=
$agent_name
;
$store_list
[
$key
]
[
"house_num"
]
=
$this
->
houseModel
->
getAddHouseNumByAgentId
(
$conditions_
);
$store_list
[
"house_num"
]
=
$this
->
houseModel
->
getAddHouseNumByAgentId
(
$conditions_
);
$store_list
[
$key
]
[
"user_num"
]
=
$this
->
userModel
->
getAddUserNumByAgentId
(
$conditions_
);
$store_list
[
"user_num"
]
=
$this
->
userModel
->
getAddUserNumByAgentId
(
$conditions_
);
$store_list
[
$key
]
[
"follow_up_num"
]
=
$this
->
followUpModel
->
getAddFollowUpNumByAgentId
(
$conditions_
);
$store_list
[
"follow_up_num"
]
=
$this
->
followUpModel
->
getAddFollowUpNumByAgentId
(
$conditions_
);
return
$store_list
;
return
$store_list
;
}
}
private
function
getDistrictList
(
$conditions
,
$district_id
){
private
function
getDistrictList
(
$conditions
,
$district_id
)
{
//根据门店统计本周人数和上周人数
//根据门店统计本周人数和上周人数
$time_start
=
$conditions
[
'time_start'
];
$time_start
=
$conditions
[
'time_start'
];
$last_week_start_time
=
date
(
"Y-m-d"
.
" 00:00:00"
,
strtotime
(
"
$time_start
-1 week"
));
$last_week_start_time
=
date
(
"Y-m-d"
.
" 00:00:00"
,
strtotime
(
"
$time_start
-1 week"
));
...
@@ -147,27 +149,27 @@ class StatementService
...
@@ -147,27 +149,27 @@ class StatementService
$where_
[
"quit_time"
]
=
array
(
'between'
,
array
(
$last_week_start_time
,
$last_week_end_time
)
);
$where_
[
"quit_time"
]
=
array
(
'between'
,
array
(
$last_week_start_time
,
$last_week_end_time
)
);
$where_
[
"district_id"
]
=
$district_id
;
$where_
[
"district_id"
]
=
$district_id
;
$result
=
$this
->
agentModel
->
countAgentNum
(
$where_
);
//上周人数
$result
=
$this
->
agentModel
->
countAgentNum
(
$where_
);
//上周人数
$conditions_
=
$conditions
;
$conditions_
=
$conditions
;
$conditions_
[
"district_id"
]
=
$district_id
;
//本周人数
$conditions_
[
"district_id"
]
=
$district_id
;
//本周人数
$results
=
$this
->
agentModel
->
countAgentNum
(
$conditions_
);
$results
=
$this
->
agentModel
->
countAgentNum
(
$conditions_
);
//dump($results);
//dump($results);
$last_week_total
=
0
;
$last_week_total
=
0
;
foreach
(
$results
as
$key
=>
$value
)
{
foreach
(
$results
as
$key
=>
$value
)
{
$last_week_total
+=
$value
[
"agent_num"
];
$last_week_total
+=
$value
[
"agent_num"
];
$paramArr
[
"store_id"
]
=
$value
[
"store_id"
];
$paramArr
[
"store_id"
]
=
$value
[
"store_id"
];
$paramArr
[
"level"
]
=
array
(
"in"
,[
20
,
40
]
);
$paramArr
[
"level"
]
=
array
(
"in"
,
[
20
,
40
]
);
$agentsResult
=
$this
->
agentModel
->
getAgentsByStoreId
(
$paramArr
);
$agentsResult
=
$this
->
agentModel
->
getAgentsByStoreId
(
$paramArr
);
$results
[
$key
][
"name"
]
=
count
(
$agentsResult
)
>
0
?
$agentsResult
[
0
][
"name"
]
:
null
;
$results
[
$key
][
"name"
]
=
count
(
$agentsResult
)
>
0
?
$agentsResult
[
0
][
"name"
]
:
null
;
foreach
(
$result
as
$i
=>
$item
)
{
foreach
(
$result
as
$i
=>
$item
)
{
if
(
$value
[
"store_id"
]
==
$item
[
"store_id"
])
{
if
(
$value
[
"store_id"
]
==
$item
[
"store_id"
])
{
$results
[
$key
][
"last_week_num"
]
=
$item
[
"agent_num"
];
$results
[
$key
][
"last_week_num"
]
=
$item
[
"agent_num"
];
}
}
}
}
}
}
$district_list
[
"last_week_total"
]
=
$last_week_total
;
$district_list
[
"last_week_total"
]
=
$last_week_total
;
$district_list
[
"district_list"
]
=
$results
;
$district_list
[
"district_list"
]
=
$results
;
return
$district_list
;
return
$district_list
;
}
}
...
...
application/index/controller/Version.php
View file @
83bc5cc7
...
@@ -58,7 +58,7 @@ class Version extends Basic
...
@@ -58,7 +58,7 @@ class Version extends Basic
if
(
!
isset
(
$param
[
"version_no"
])
||
!
isset
(
$param
[
"type"
]))
{
if
(
!
isset
(
$param
[
"version_no"
])
||
!
isset
(
$param
[
"type"
]))
{
$this
->
response
(
"101"
,
"版本号或app类型不能为空"
);
$this
->
response
(
"101"
,
"版本号或app类型不能为空"
);
}
}
if
(
$param
[
"type"
]
==
'android'
&&
isset
(
$param
[
"app_path"
]))
{
if
(
$param
[
"type"
]
==
0
||
$param
[
"type"
]
==
2
&&
isset
(
$param
[
"app_path"
]))
{
$this
->
response
(
"101"
,
"安卓请上传安装包"
);
$this
->
response
(
"101"
,
"安卓请上传安装包"
);
}
}
$param
[
"create_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
$param
[
"create_time"
]
=
date
(
"Y-m-d H:i:s"
,
time
());
...
...
application/index/view/version/index.html
View file @
83bc5cc7
...
@@ -24,15 +24,27 @@
...
@@ -24,15 +24,27 @@
<div
class=
"col-sm-9"
>
<div
class=
"col-sm-9"
>
<div
class=
"radio"
style=
"display: inline-block"
>
<div
class=
"radio"
style=
"display: inline-block"
>
<label>
<label>
<input
type=
"radio"
name=
"optionsRadios"
id=
"optionsRadios1"
value=
"
android
"
<input
type=
"radio"
name=
"optionsRadios"
id=
"optionsRadios1"
value=
"
0
"
checked
>
android
checked
>
android
(用户端)
</label>
</label>
</div>
</div>
<div
class=
"radio"
style=
"display: inline-block"
>
<div
class=
"radio"
style=
"display: inline-block"
>
<label>
<label>
<input
type=
"radio"
name=
"optionsRadios"
id=
"optionsRadios2"
<input
type=
"radio"
name=
"optionsRadios"
id=
"optionsRadios2"
value=
"ios"
>
ios
value=
"1"
>
ios(用户端)
</label>
</div>
<div
class=
"radio"
style=
"display: inline-block"
>
<label>
<input
type=
"radio"
name=
"optionsRadios"
id=
"optionsRadios3"
value=
"2"
>
android(经纪人端)
</label>
</div>
<div
class=
"radio"
style=
"display: inline-block"
>
<label>
<input
type=
"radio"
name=
"optionsRadios"
id=
"optionsRadios4"
value=
"3"
>
ios(经纪人端)
</label>
</label>
</div>
</div>
</div>
</div>
...
...
application/model/AppVersion.php
View file @
83bc5cc7
...
@@ -37,7 +37,7 @@ class AppVersion extends Model
...
@@ -37,7 +37,7 @@ class AppVersion extends Model
public
function
getVersionList
()
public
function
getVersionList
()
{
{
$param
[
"is_del"
]
=
0
;
$param
[
"is_del"
]
=
0
;
return
$this
->
field
(
"id,version_no,IF(type =
0
,'ios','android') as type ,create_time,intro,app_path"
)
return
$this
->
field
(
"id,version_no,IF(type =
1
,'ios','android') as type ,create_time,intro,app_path"
)
->
where
(
$param
)
->
where
(
$param
)
->
order
(
"id desc"
)
->
order
(
"id desc"
)
->
select
();
->
select
();
...
...
public/resource/js/version.js
View file @
83bc5cc7
/**
/**
* Created by zw on 2017/12/15.
* Created by zw on 2017/12/15.
*/
*/
define
([
'doT'
,
'text!temp/version_template_tpl.html'
,
'ckfinder'
,
'ckfinderStart'
,
'css!style/home.css'
],
function
(
doT
,
template
)
{
define
([
'doT'
,
'text!temp/version_template_tpl.html'
,
'ckfinder'
,
'ckfinderStart'
,
'css!style/home.css'
],
function
(
doT
,
template
)
{
var
Version
=
{
var
Version
=
{
init
:
function
()
{
init
:
function
()
{
//初始化dot
//初始化dot
$
(
"body"
).
append
(
template
);
$
(
"body"
).
append
(
template
);
Version
.
getVersion
();
Version
.
getVersion
();
Version
.
getVersionList
();
Version
.
getVersionList
();
Version
.
event
();
Version
.
event
();
},
},
event
:
function
()
{
event
:
function
()
{
/*上传图片控件*/
/*上传图片控件*/
/* $ (".banner_img").click (function () {
/* $ (".banner_img").click (function () {
BrowseServer ('cover_image');
BrowseServer ('cover_image');
});*/
});*/
$
(
"#save"
).
click
(
function
()
{
$
(
"#save"
).
click
(
function
()
{
var
params
=
{};
var
params
=
{};
params
.
type
=
$
(
"input[name = optionsRadios]:checked"
).
val
();
params
.
type
=
$
(
"input[name = optionsRadios]:checked"
).
val
();
params
.
version_no
=
$
(
"#version_no"
).
val
();
params
.
version_no
=
$
(
"#version_no"
).
val
();
params
.
app_path
=
$
(
"#cover_image"
).
val
();
params
.
app_path
=
$
(
"#cover_image"
).
val
();
params
.
intro
=
$
(
"#intro"
).
val
();
params
.
intro
=
$
(
"#intro"
).
val
();
if
(
!
params
.
type
||
params
.
type
==
null
)
{
if
(
!
params
.
type
||
params
.
type
==
null
)
{
alert
(
"类型不能为空"
);
alert
(
"类型不能为空"
);
return
false
;
return
false
;
}
}
if
(
!
params
.
version_no
||
params
.
version_no
==
null
)
{
if
(
!
params
.
version_no
||
params
.
version_no
==
null
)
{
alert
(
"版本号不能为空"
);
alert
(
"版本号不能为空"
);
return
false
;
return
false
;
}
}
if
(
params
.
type
===
"android"
&&
params
.
app_path
==
null
||
!
params
.
version_no
)
{
if
(
params
.
type
===
0
||
params
.
type
===
2
&&
params
.
app_path
==
null
||
!
params
.
version_no
)
{
alert
(
"下载地址不能为空"
);
alert
(
"下载地址不能为空"
);
return
false
;
return
false
;
}
}
Version
.
addVersion
(
params
);
Version
.
addVersion
(
params
);
});
});
$
(
"input[name=optionsRadios]"
).
click
(
function
()
{
$
(
"input[name=optionsRadios]"
).
click
(
function
()
{
if
(
$
(
"input[name = optionsRadios]:checked"
).
val
()
===
'ios'
)
{
var
val
=
$
(
"input[name = optionsRadios]:checked"
).
val
();
$
(
".show_select_page"
).
hide
();
if
(
val
==
1
||
val
==
3
)
{
}
else
{
$
(
".show_select_page"
).
hide
();
$
(
".show_select_page"
).
show
();
}
else
{
$
(
".show_select_page"
).
show
();
}
}
Version
.
getVersion
();
Version
.
getVersion
();
});
});
},
},
getVersion
:
function
()
{
getVersion
:
function
()
{
var
param
=
{};
var
param
=
{};
param
.
type
=
$
(
"input[name = optionsRadios]:checked"
).
val
();
param
.
type
=
$
(
"input[name = optionsRadios]:checked"
).
val
();
$
.
ajax
({
$
.
ajax
({
url
:
'/admin.php/index/getVersionNo'
,
url
:
'/admin.php/index/getVersionNo'
,
type
:
'POST'
,
type
:
'POST'
,
async
:
true
,
async
:
true
,
data
:
param
,
data
:
param
,
dataType
:
'json'
,
dataType
:
'json'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
console
.
log
(
data
);
console
.
log
(
data
);
if
(
data
.
data
)
{
if
(
data
.
data
)
{
$
(
"#now_version"
).
html
(
data
.
data
[
'version_no'
]);
$
(
"#now_version"
).
html
(
data
.
data
[
'version_no'
]);
}
else
{
}
else
{
$
(
"#now_version"
).
html
(
"暂未获取到最新版本号"
);
$
(
"#now_version"
).
html
(
"暂未获取到最新版本号"
);
}
}
}
}
...
@@ -75,23 +76,24 @@ define (['doT', 'text!temp/version_template_tpl.html', 'ckfinder', 'ckfinderStar
...
@@ -75,23 +76,24 @@ define (['doT', 'text!temp/version_template_tpl.html', 'ckfinder', 'ckfinderStar
},
},
getVersionList
:
function
(
pageNo
)
{
getVersionList
:
function
(
pageNo
)
{
$
.
ajax
({
$
.
ajax
({
url
:
'/admin.php/index/getVersionList'
,
url
:
'/admin.php/index/getVersionList'
,
type
:
'POST'
,
type
:
'POST'
,
async
:
true
,
async
:
true
,
data
:
{},
data
:
{},
dataType
:
'json'
,
dataType
:
'json'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
console
.
log
(
data
.
data
);
console
.
log
(
data
.
data
);
var
temp
=
document
.
getElementById
(
'version_list_tpl'
).
innerHTML
;
var
temp
=
document
.
getElementById
(
'version_list_tpl'
).
innerHTML
;
var
doTtmpl
=
doT
.
template
(
temp
);
var
doTtmpl
=
doT
.
template
(
temp
);
$
(
"#sublet_list"
).
html
(
doTtmpl
(
data
.
data
));
$
(
"#sublet_list"
).
html
(
doTtmpl
(
data
.
data
));
}
}
});
});
},
},
addVersion
:
function
(
params
)
{
addVersion
:
function
(
params
)
{
$
.
ajax
({
$
.
ajax
({
url
:
'/admin.php/index/addVersion'
,
url
:
'/admin.php/index/addVersion'
,
type
:
'POST'
,
type
:
'POST'
,
async
:
true
,
async
:
true
,
...
@@ -99,9 +101,9 @@ define (['doT', 'text!temp/version_template_tpl.html', 'ckfinder', 'ckfinderStar
...
@@ -99,9 +101,9 @@ define (['doT', 'text!temp/version_template_tpl.html', 'ckfinder', 'ckfinderStar
dataType
:
'json'
,
dataType
:
'json'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
if
(
data
.
code
==
"101"
)
{
if
(
data
.
code
==
"101"
)
{
alert
(
data
.
msg
);
alert
(
data
.
msg
);
return
false
;
return
false
;
}
else
{
}
else
{
window
.
location
.
reload
(
true
);
window
.
location
.
reload
(
true
);
}
}
...
@@ -111,19 +113,19 @@ define (['doT', 'text!temp/version_template_tpl.html', 'ckfinder', 'ckfinderStar
...
@@ -111,19 +113,19 @@ define (['doT', 'text!temp/version_template_tpl.html', 'ckfinder', 'ckfinderStar
},
},
deleteBanner
:
function
(
params
)
{
deleteBanner
:
function
(
params
)
{
$
.
ajax
({
$
.
ajax
({
url
:
'/admin.php/index/upIsShow'
,
url
:
'/admin.php/index/upIsShow'
,
type
:
'POST'
,
type
:
'POST'
,
async
:
true
,
async
:
true
,
data
:
params
,
data
:
params
,
dataType
:
'json'
,
dataType
:
'json'
,
success
:
function
(
data
)
{
success
:
function
(
data
)
{
$
(
"#modal-delete"
).
modal
(
'hide'
);
$
(
"#modal-delete"
).
modal
(
'hide'
);
if
(
data
.
code
==
"101"
)
{
if
(
data
.
code
==
"101"
)
{
alert
(
data
.
msg
);
alert
(
data
.
msg
);
return
false
;
return
false
;
}
}
banner
.
getBannerList
(
banner
.
pageNo
);
banner
.
getBannerList
(
banner
.
pageNo
);
}
}
});
});
...
...
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