Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sunac-quanmin
Overview
Overview
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
HTML5-李恒逸
sunac-quanmin
Commits
203afb92
Commit
203afb92
authored
Jul 12, 2017
by
HTML5-侯张振
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
分销商保护期变更
parent
0afbdea0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
128 additions
and
23 deletions
+128
-23
distributionadmin.php
html/application/controllers/admin/distributionadmin.php
+1
-0
index.php
html/application/controllers/admin/index.php
+5
-4
report.php
html/application/controllers/admin/report.php
+0
-0
weixin.php
html/application/controllers/distributor/weixin.php
+1
-1
distributor_model.php
html/application/models/distributor_model.php
+6
-0
distributorAdd.php
html/application/views/admin/report/distributorAdd.php
+31
-7
updateDay.php
html/application/views/admin/report/updateDay.php
+77
-10
distributor.php
html/application/views/admin/sales/distributor.php
+1
-1
distributorAdd.php
html/application/views/admin/sales/distributorAdd.php
+6
-0
No files found.
html/application/controllers/admin/distributionadmin.php
View file @
203afb92
...
...
@@ -382,6 +382,7 @@ class Distributionadmin extends CI_Controller
$dataR
[
'distributor_id'
]
=
$distributor_id
;
$dataR
[
'building_id'
]
=
$building_ids
[
$i
];
$dataR
[
'create_time'
]
=
time
();
$dataR
[
'set_protection'
]
=
$post
[
'protection'
];
$this
->
relate
->
add
(
$dataR
);
}
...
...
html/application/controllers/admin/index.php
View file @
203afb92
...
...
@@ -48,13 +48,13 @@ class Index extends CI_Controller{
alert_redirect
(
site_url
(
'admin/index/login'
));
return
;
}
$user_data
=
$this
->
session
->
userdata
;
//获取总数
$this
->
load
->
model
(
'user_model'
,
'user'
);
$this
->
data
[
'user_count'
]
=
$this
->
user
->
get_count
(
array
(
'user_type'
=>
2
,
'user_role'
=>
0
,
'is_deleted'
=>
0
));
$this
->
load
->
model
(
'building_model'
,
'building'
);
$this
->
data
[
'building_count'
]
=
$this
->
building
->
get_building_count
(
array
(
'B.is_deleted'
=>
0
));
$this
->
load
->
model
(
'customer_building_model'
,
'customer_building'
);
$this
->
data
[
'sales_count'
]
=
$this
->
customer_building
->
get_count
(
array
(
'is_deleted'
=>
0
,
'recommend_status'
=>
4
));
...
...
@@ -64,14 +64,14 @@ class Index extends CI_Controller{
//操作日志
$this
->
load
->
model
(
'op_log_model'
);
$logs
=
$this
->
op_log_model
->
get_page
(
array
(
'manager_id'
=>
$manager_id
),
'id desc'
,
1
,
self
::
PAGE_SIZE
+
2
);
$this
->
load
->
model
(
'building_distributor_model'
,
'building_distributor'
);
//销管与分销商的关联
//销管登录,有小红点
$last
=
$this
->
op_log_model
->
get_last_by_manager
(
$manager_id
);
$last_time
=
$last
[
'create_time'
];
$update_time
=
$last
[
'update_time'
]
?
:
'0'
;
if
(
$update_time
)
{
$where
=
'M.id = '
.
$manager_id
.
' and CB.distributor_id > 0 and CB.create_time >='
.
$update_time
;
...
...
@@ -80,9 +80,10 @@ class Index extends CI_Controller{
}
$this
->
op_log_model
->
update_time
(
$last
[
'id'
]);
$red_count
=
$this
->
customer_building
->
get_count_by_where
(
$where
);
$this
->
data
[
'red_count'
]
=
$red_count
;
$this
->
data
[
'log_data'
]
=
$logs
;
$this
->
load
->
view
(
'admin/index'
,
$this
->
data
);
}
//定期获取未读的报备客户数量
...
...
html/application/controllers/admin/report.php
View file @
203afb92
This diff is collapsed.
Click to expand it.
html/application/controllers/distributor/weixin.php
View file @
203afb92
...
...
@@ -3,7 +3,7 @@
* 微信快速登陆
* Class Controller_Index
*/
class
Controller_Index
extends
Stourweb
_Controller
class
Weixin
extends
CI
_Controller
{
private
$_api
;
private
$_conf
=
null
;
...
...
html/application/models/distributor_model.php
View file @
203afb92
...
...
@@ -197,5 +197,10 @@ class Distributor_model extends MY_Model{
}
return
array
();
}
public
function
updata_set_protection
(
$id
,
$distributor
,
$protection
){
$this
->
db
->
where
(
'building_id = '
.
$id
.
' and distributor_id = '
.
$distributor
);
$this
->
db
->
update
(
'tb_building_distributor_relate'
,
$protection
);
}
}
\ No newline at end of file
html/application/views/admin/report/distributorAdd.php
View file @
203afb92
...
...
@@ -62,6 +62,15 @@
</table>
</div>
</div>
<div
class=
"protection_alert"
style=
"position: absolute;height: 150px;width: 500px;background: #DB6;top: 50%;left: 30%;display: none;"
>
<label
style=
"padding-top:10%;padding-left:15%;"
>
设置保护期
<input
id=
"protection_v"
type=
"text"
value=
""
style=
"width:230px;outline:none;margin-left:20px;"
name=
"protection"
>
</label>
<div
style=
"width:100%;padding-top:30px;"
>
<button
class=
"alert_none"
style=
"display: block;width: 50px;float: right;margin-right:20px;background:#4d90fe;outline:none;border: none;"
>
确定
</button>
<button
class=
"alert_determine"
style=
"display: block;width: 50px;float: right;margin-right:20px;background:#d84a38;outline:none;border:none"
>
取消
</button>
</div>
</div>
</div>
</div>
</div>
...
...
@@ -83,7 +92,7 @@
<script
type=
"text/javascript"
>
jQuery
(
document
).
ready
(
function
()
{
App
.
init
();
var
protection
=
''
;
$
(
'form'
).
submit
(
function
(
event
)
{
event
.
preventDefault
();
var
_type
=
$
(
'#type'
).
val
();
...
...
@@ -112,7 +121,7 @@ jQuery(document).ready(function() {
_html
+=
'<td>'
+
item
.
uniqid_id
+
'</td>'
;
_html
+=
'<td>'
+
item
.
building_title
+
'</td>'
;
//_html += '
<
td
>
' + item.remark + '
<
/td>';
_html
+=
'<td><a class="btn sel default btn-xs purple" href="javascript:;" data-href="'
+
_selectUrl
+
'/'
+
item
.
distributor_id
+
'_'
+
item
.
building_id
+
'">选择此分销商</a></td>'
;
_html
+=
'<td><a class="btn sel default btn-xs purple" href="javascript:;" data-href="'
+
_selectUrl
+
'/'
+
item
.
distributor_id
+
'_'
+
item
.
building_id
+
'">选择此分销商</a></td>'
;
_html
+=
'</tr>'
;
}
...
...
@@ -130,12 +139,27 @@ jQuery(document).ready(function() {
})
});
$
(
'#add-con'
).
delegate
(
'.sel'
,
'click'
,
function
()
{
if
(
confirm
(
'确定选择此分销商?'
))
{
window
.
location
.
href
=
$
(
this
).
attr
(
'data-href'
);
}
$
(
'#add-con'
).
delegate
(
'.sel'
,
'click'
,
function
(
e
)
{
e
.
stopPropagation
()
$
(
".protection_alert"
).
css
({
"display"
:
"block"
});
var
_this
=
$
(
this
);
// if (confirm('确定选择此分销商?')) {
// window.location.href = $(this).attr('data-href');
// }
$
(
".alert_none"
).
click
(
function
(
e
){
e
.
stopPropagation
();
$
(
".protection_alert"
).
css
({
"display"
:
"none"
});
protection
=
$
(
'#protection_v'
).
val
();
window
.
location
.
href
=
_this
.
attr
(
'data-href'
)
+
'_'
+
protection
;
})
});
$
(
".alert_determine"
).
click
(
function
(
e
){
e
.
stopPropagation
();
$
(
".protection_alert"
).
css
({
"display"
:
"none"
});
})
});
</script>
</body>
...
...
html/application/views/admin/report/updateDay.php
View file @
203afb92
...
...
@@ -28,29 +28,49 @@
</div>
<div
class=
"portlet-body form"
>
<!-- BEGIN FORM-->
<form
action=
"
<?php
echo
site_url
(
'admin/report/updateDay'
);
?>
"
method=
"post
"
class=
"form-horizontal"
>
<form
action=
"
"
method=
"post"
id=
"form
"
class=
"form-horizontal"
>
<div
class=
"form-body"
>
<div
class=
"row"
>
<div
class=
"col-md-10"
>
<div
class=
"form-group"
>
<label
class=
"control-label col-md-2"
>
项目名称:
</label>
<div
class=
"col-md-4"
>
<input
type=
"text"
readonly=
"readonly"
class=
"form-control"
id=
"building_title"
name=
"building_title"
value=
"
<?php
echo
isset
(
$info
[
'building_title'
])
?
$info
[
'building_title'
]
:
""
;
?>
"
>
<input
type=
"text"
readonly=
"readonly"
class=
"form-control"
id=
"building_title"
name=
"building_title
[]
"
value=
"
<?php
echo
isset
(
$info
[
'building_title'
])
?
$info
[
'building_title'
]
:
""
;
?>
"
>
</div>
</div>
<div
class=
"form-group"
>
<
!--<
div class="form-group">
<label class="control-label col-md-2">当前保护期(天):</label>
<div class="col-md-4">
<?php
echo
!
empty
(
$info
[
'valid_day'
])
?
$info
[
'valid_day'
]
:
"7"
;
?>
</div>
</div>-->
<div
class=
"form-group"
>
<label
class=
"control-label col-md-2"
>
设置保护期(天):
</label>
<div
class=
"col-md-4"
>
<input
type=
"text"
class=
"form-control"
id=
"valid_day"
name=
"valid_day[]"
value=
""
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-md-2"
>
修改保护期(天)
:
</label>
<label
class=
"control-label col-md-2"
>
搜索分销商
:
</label>
<div
class=
"col-md-4"
>
<input
type=
"text"
class=
"form-control"
id=
"
valid_day"
name=
"valid_day
"
value=
""
>
<input
type=
"text"
class=
"form-control"
id=
"
comany_name"
name=
"company_name[]
"
value=
""
>
</div>
<div
class=
"col-md-1"
style=
"height: 34px; background: #4d90fe;color:#fff;line-height: 34px;text-align: center;"
id=
"search_distributors"
>
搜索
</div>
</div>
<label
style=
"width: 24%;float: left;"
>
<input
id=
"all"
type=
"checkbox"
checked=
"checked"
name=
"building_all[]"
value=
""
>
全选
</label>
<br/><br/>
<div
class=
"form-group"
id=
"checked_list"
style=
"padding-left:15px;"
>
<?php
foreach
(
$admins
as
$i
=>
$admin
)
:?>
<
label
style
=
"width: 24%;float: left;"
>
<
input
type
=
"checkbox"
class
="
checked_list
" checked="
checked
" name="
manager_id
[]
" value="
<?
php
echo
$admins
[
$i
][
'manager_id'
]
?>
">
<?php
echo
$admins
[
$i
][
"company_name"
];
?>
</label>
<?php
endforeach
?>
</div>
</div>
</div>
</div>
...
...
@@ -94,21 +114,68 @@ jQuery(document).ready(function() {
$
(
"#prev-btn"
).
click
(
function
(){
var
valid_day
=
$
(
"#valid_day"
).
val
();
if
(
valid_day
==
''
)
// console.log($('.checked_list').parent().attr('class'));
var
num_array
=
[];
num_array
=
"
<?php
echo
sizeof
(
$admins
)
?>
"
;
console
.
log
(
num_array
);
for
(
var
i
=
0
;
i
<
(
Number
(
num_array
)
+
1
);
i
++
){
if
(
$
(
'.checked_list'
).
parent
().
eq
(
i
).
attr
(
'class'
)
!=
'checked'
){
$
(
'.checked_list'
).
eq
(
i
).
val
(
""
);
}
}
//验证保护期是否填写
if
(
valid_day
==
''
)
{
alert
(
'请填写保护期'
);
$
(
"#valid_day"
).
focus
();
return
false
;
}
$
(
form
).
submit
();
$
.
ajax
({
url
:
"
<?php
echo
site_url
(
'admin/report/updateDay'
);
?>
"
,
type
:
'post'
,
dataType
:
'json'
,
data
:
$
(
'#form'
).
serialize
(),
success
:
function
(
res
){
if
(
res
.
errcode
==
0
)
{
window
.
location
.
href
=
"
<?php
echo
site_url
(
'admin/report/circulation'
);
?>
"
}
else
{
alert
(
0
);
}
}
});
});
$
(
'.back-btn'
).
click
(
function
(){
history
.
go
(
-
1
);
})
$
(
'#search_distributors'
).
click
(
function
(){
var
html
=
''
;
console
.
log
(
55
);
var
comany_name
=
$
(
'#comany_name'
).
val
();
<?php
foreach
(
$admins
as
$i
=>
$admin
)
:?>
var
companyof
=
"<?php echo
$admins[$i]['company_name']
?>"
var
companyofi
=
"<?php echo
$admins[$i]['manager_id']
?>"
if
(
!
companyof
.
indexOf
(
comany_name
)){
html
+=
'<label style="width: 24%;float: left;"><div class="checker"><span class="checked"><input type="checkbox" class="checked_list" checked="checked" name="manager_id[]" value="'
+
companyofi
+
'"></span></div>'
+
companyof
+
'</label>'
}
<?
php
endforeach
?>
$
(
'#checked_list'
).
html
(
html
);
});
$
(
".form-body"
).
on
(
'click'
,
'#all'
,
function
(){
console
.
log
(
12211
);
if
(
this
.
checked
){
console
.
log
(
3
);
$
(
".checked_list"
).
parent
().
addClass
(
'checked'
);
}
else
{
$
(
".checked_list"
).
parent
().
removeClass
(
'checked'
);
}
});
});
</script>
</body>
...
...
html/application/views/admin/sales/distributor.php
View file @
203afb92
...
...
@@ -41,7 +41,7 @@
<div
class=
"portlet-body"
>
<div
class=
"table-toolbar"
>
<div
class=
"btn-group"
>
<?php
if
(
$role
!=
1
0
){
?>
<?php
if
(
$role
!=
1
2
){
?>
<button
class=
"btn green"
onclick=
"window.location.href='
<?php
echo
site_url
(
'/admin/distributionadmin/distributorAdd'
);
?>
'"
>
新增分销商
<i
class=
"fa fa-plus"
></i>
</button>
<?php
}
?>
</div>
...
...
html/application/views/admin/sales/distributorAdd.php
View file @
203afb92
...
...
@@ -190,6 +190,12 @@
<input
type=
"text"
class=
"form-control"
id=
"remark"
name=
"remark"
value=
"
<?php
echo
isset
(
$data
[
'remark'
])
?
$data
[
'remark'
]
:
''
?>
"
>
</div>
</div>
<div
class=
"form-group"
>
<label
class=
"control-label col-md-3"
>
保护期设置
</label>
<div
class=
"col-md-4"
>
<input
type=
"text"
class=
"form-control"
id=
"protection"
name=
"protection"
value=
""
>
</div>
</div>
</div>
<div
class=
"form-actions fluid"
>
<div
class=
"col-md-offset-3 col-md-9"
>
...
...
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