Commit ae121a96 by html5-李恒逸

修改二次报备页面跳转

parent 525c511f
<?php
/**
* 客户楼盘关联模型
*
*
* @package application/model
* @version 2012-10-31
* @author wenhuijang
......@@ -13,7 +13,7 @@ class Customer_building_model extends MY_Model{
* 使用到的表
*/
public $table = 'tb_customer_building';
/**
* 构造器
*/
......@@ -23,7 +23,7 @@ class Customer_building_model extends MY_Model{
//进行数据库连接
$this->db = $this->load->database('default', true);
}
/**
* 总数
* @param int $where
......@@ -124,11 +124,11 @@ class Customer_building_model extends MY_Model{
$this->db->where($where);
}
$query = $this->db->get();
if($query->num_rows() > 0)
{
$return = $query->row_array();
return $return['total'];
}
return 0;
......@@ -154,16 +154,16 @@ class Customer_building_model extends MY_Model{
if(!empty($where))
{
$this->db->where($where);
}
$this->db->order_by('CB.id','desc');
$query = $this->db->get(null,$page_size, ($page-1) * $page_size);
if($query->num_rows() > 0)
{
$return = $query->result_array();
return $return;
}
return array();
......@@ -183,17 +183,20 @@ class Customer_building_model extends MY_Model{
->join('tb_channel CC', 'CC.id=D.channel_id', 'left')
->join('tb_manager TM', 'TM.id=CC.manager_id', 'left')
->join('tb_building_distributor_relate RR','RR.building_id=CB.building_id AND D.id=RR.distributor_id', 'left')
->join('tb_manager M','RR.user_id=M.id', 'left')
->where('CB.report_time <> 0');
->join('tb_manager M','RR.user_id=M.id', 'left');
if(!empty($where))
{
$this->db->where($where);
}
$this->db->order_by('CB.id','desc');
$query = $this->db->get(null,$page_size, ($page-1) * $page_size);
if($query->num_rows() > 0)
{
$return = $query->result_array();
return $return;
}
return array();
......@@ -240,7 +243,7 @@ class Customer_building_model extends MY_Model{
}
return false;
}
/**
* 分页数据
* @param string $where
......@@ -253,9 +256,9 @@ class Customer_building_model extends MY_Model{
public function get_customer_building_page($where = NULL, $page = 0, $page_size = 0, $order = NULL)
{
$this->db->select('
CB.*, R.region_name, B.building_title,
C.customer_user, C.customer_mobile,
UP.true_name as sales_name,
CB.*, R.region_name, B.building_title,
C.customer_user, C.customer_mobile,
UP.true_name as sales_name,
U.true_name as recom_name, U.check_status
')
->from('tb_customer_building CB')
......@@ -264,7 +267,7 @@ class Customer_building_model extends MY_Model{
->join('tb_region R', 'R.region_code = CB.city_code ', 'left')
->join('tb_user UP', 'UP.id = CB.sale_id', 'left')
->join('tb_user U', 'U.id = CB.user_id', 'left');
if(!empty($where))
{
$this->db->where($where);
......@@ -275,7 +278,7 @@ class Customer_building_model extends MY_Model{
}else {
$this->db->order_by('CB.id','desc');
}
$query = $this->db->get(NULL, $page_size, ($page-1) * $page_size);
if($query->num_rows() > 0)
{
......@@ -283,26 +286,26 @@ class Customer_building_model extends MY_Model{
}
return false;
}
/**
* 管理后台详情(佣金详情)
* @param string $where
* @return boolean
*/
public function get_customer_building_info($where = NULL){
$this->db->select('CB.*, R.region_name,
$this->db->select('CB.*, R.region_name,
B.building_title, B.sort_num, B.building_addr, B.contact_user, B.contact_mobile, B.remark,
C.customer_user, C.customer_mobile')
->from('tb_customer_building CB')
->join('tb_customer C', 'C.id = CB.customer_id ', 'left')
->join('tb_building B', 'B.id = CB.building_id ', 'left')
->join('tb_region R', 'R.region_code = CB.city_code ', 'left');
if(!empty($where))
{
$this->db->where($where);
}
$query = $this->db->get();
if($query->num_rows() > 0)
{
......@@ -310,7 +313,7 @@ class Customer_building_model extends MY_Model{
}
return false;
}
/**
* 前台列表数据(佣金列表, 销售客户列表)
* @param string $where
......@@ -328,7 +331,7 @@ class Customer_building_model extends MY_Model{
->join('tb_building B', 'B.id = CB.building_id ', 'left')
->join('tb_user U', 'U.id = CB.user_id', 'left')
->join('tb_distributor D','D.uniqid_id=U.uniqid_id','left');
if(!empty($where))
{
$this->db->where($where);
......@@ -339,7 +342,7 @@ class Customer_building_model extends MY_Model{
}else {
$this->db->order_by('CB.update_time','desc');
}
$query = $this->db->get(NULL, $page_size, ($page-1) * $page_size);
if($query->num_rows() > 0)
{
......@@ -347,26 +350,26 @@ class Customer_building_model extends MY_Model{
}
return false;
}
/**
* 前台顾客详情
*
*
* @param string $where
* @return boolean
*/
public function get_customer_building_web_info($where = NULL){
$this->db->select('CB.*, R.region_name, B.building_id as rc_building_id, B.building_title, C.customer_user, C.customer_mobile')
->from('tb_customer_building CB')
->join('tb_customer C', 'C.id = CB.customer_id ', 'left')
->join('tb_building B', 'B.id = CB.building_id ', 'left')
->join('tb_region R', 'R.region_code = CB.city_code ', 'left');
if(!empty($where))
{
$this->db->where($where);
}
$query = $this->db->get();
if($query->num_rows() > 0)
{
......@@ -374,7 +377,7 @@ class Customer_building_model extends MY_Model{
}
return false;
}
/**
*
* 前台 销售经理获取负责楼盘项目数据
......@@ -392,7 +395,7 @@ class Customer_building_model extends MY_Model{
)
->from('tb_customer_building CB')
->join('tb_building B', 'CB.building_id = B.id', 'left');
if(!empty($where))
{
$this->db->where($where);
......@@ -423,7 +426,7 @@ class Customer_building_model extends MY_Model{
)
->from('tb_customer_building CB')
->join('tb_user U', 'CB.user_id = U.id', 'left');
if(!empty($where))
{
$this->db->where($where);
......@@ -460,7 +463,7 @@ class Customer_building_model extends MY_Model{
}
$this->db->group_by('CB.city_code');
$this->db->order_by('CB.city_code desc');
$query = $this->db->get(null);
if($query->num_rows() > 0)
{
......@@ -468,8 +471,8 @@ class Customer_building_model extends MY_Model{
}
return false;
}
/**
* 客户是否被推荐
*
......@@ -477,16 +480,16 @@ class Customer_building_model extends MY_Model{
* @return boolean
*/
public function exits_customer_building($where = NULL, $getall = false){
$this->db->select('CB.id,CB.recommend_status,CB.customer_id,CB.is_valid,CB.distribution_status,CB.distributor_id')
->from('tb_customer_building CB')
->join('tb_customer C', 'C.id = CB.customer_id ', 'left');
if(!empty($where))
{
$this->db->where($where);
}
$query = $this->db->get();
if($query->num_rows() > 0)
{
......@@ -516,7 +519,7 @@ class Customer_building_model extends MY_Model{
}
$this->db->order_by('CB.create_time desc');
if (!$page)
if (!$page)
{
$query = $this->db->get();
} else {
......@@ -658,7 +661,7 @@ class Customer_building_model extends MY_Model{
$this->db->where('customer_id', $customerId);
$this->db->update('tb_customer_building',$status);
}
//获取‘tb_customer_building’里的id
public function get_building_id($Id){
$this->db->select('CB.id');
......@@ -671,4 +674,4 @@ class Customer_building_model extends MY_Model{
}
return false;
}
}
\ No newline at end of file
}
......@@ -38,7 +38,7 @@
overflow-y:auto;
border:1px solid #ddd
}
.userList li:hover{
background:#fff;
color: #000;
......@@ -49,18 +49,18 @@
</style>
<div class="clearfix"> </div>
<!-- BEGIN CONTAINER -->
<div class="page-container">
<div class="page-container">
<!-- BEGIN SIDEBAR -->
<?php $this->load->view('admin/leftbar');?>
<!-- END SIDEBAR -->
<!-- END SIDEBAR -->
<!-- BEGIN CONTENT -->
<div class="page-content-wrapper">
<div class="page-content">
<div class="page-content">
<!-- BEGIN PAGE HEADER-->
<div class="row">
<div class="col-md-12">
<div class="col-md-12">
<!-- BEGIN PAGE TITLE & BREADCRUMB-->
<ul class="page-breadcrumb breadcrumb">
<li> <i class="fa fa-home"></i> <a href="<?php echo site_url('admin/index');?>"> 主页 </a> <i class="fa fa-angle-right"></i> </li>
......@@ -68,20 +68,20 @@
<li> <a href="<?php echo site_url('admin/report');?>">客户报备</a> <i class="fa fa-angle-right"></i> </li>
<li> <a href="javascript:;"> 二次报备 </a> </li>
</ul>
<!-- END PAGE TITLE & BREADCRUMB-->
<!-- END PAGE TITLE & BREADCRUMB-->
</div>
</div>
<!-- END PAGE HEADER-->
<!-- END PAGE HEADER-->
<!-- BEGIN PAGE CONTENT-->
<div class="row">
<div class="col-md-12">
<div class="col-md-12">
<!-- BEGIN EXAMPLE TABLE PORTLET-->
<div class="portlet box blue">
<div class="portlet box blue">
<div class="portlet-body clearfix">
<div class="form-body" style="padding:0">
<div style="padding-left:5px;margin-bottom: 20px;background: #F9FCEF;padding: 10px 0;border: 1px solid #ccc;" class="text-left">
<form action="<?php echo site_url('admin/report/index');?>" name='form' method="get" style="padding-left:5px;">
<form action="<?php echo site_url('admin/report/reportAgain');?>" name='form' method="get" style="padding-left:5px;">
<input type="hidden" id="data_type" name="data_type" value="<?php echo $con_arr['data_type']; ?>">
分销商名称:
<input type="text" class="form-control input-inline input-small" name="company_name" value="<?php echo $con_arr['company_name'];?>">
......@@ -97,7 +97,7 @@
结束时间:
<input id='end_day' name="end_day" type="text" class="form-control input-inline date-picker" style="width:135px;" value="<?php echo $con_arr['end_day'];?>">
<div class="checkbox">
报备状态:
<?php if ($recommend_status) {
......@@ -109,11 +109,11 @@
</label>
<?php }
} ?>
</div>
<div style='margin-top:5px;'></div>
<button type="submit" class="btn blue" id="search">搜索</button>
<input type="reset" class="btn red reset" name="button2" value="清空">
<button class="btn green" id="export">导出</button>
</form>
......@@ -158,13 +158,13 @@
<td><?php echo $customer['Mtrue_name'];?></td>
<td><?php echo $customer['agent_name'];?></td>
<!-- <td><?php //echo $customer['remark']; ?></td> -->
<td>
<?php if ($customer['report_status'] == 'PENDING') { ?>
<a href="javascript:void(0)" class="agree btn default btn-xs" data-id="<?php echo $customer['id']; ?>"><i class="fa fa-retweet">同意</i></a>
<a href="javascript:void(0)" class="reject btn default red btn-xs" data-id="<?php echo $customer['id']; ?>><i class="fa fa-pencil-square-o">拒绝</i></a>
<?php } else {
<?php } else {
if ($customer['report_status'] == 'SUCCESS') echo '已同意二次报备';
if ($customer['report_status'] == 'REJECT') echo '已拒绝二次报备';
}?>
......@@ -200,29 +200,29 @@
</div>
</div>
</div>
<!-- END EXAMPLE TABLE PORTLET-->
<!-- END EXAMPLE TABLE PORTLET-->
</div>
</div>
<!-- END PAGE CONTENT-->
<!-- END PAGE CONTENT-->
</div>
</div>
<!-- END CONTENT -->
<!-- END CONTENT -->
</div>
<!-- END CONTAINER -->
<!-- END CONTAINER -->
<!-- BEGIN FOOTER -->
<?php $this->load->view('admin/footer');?>
<!-- BEGIN PAGE LEVEL PLUGINS -->
<link rel="stylesheet" href="<?php echo APPLICATION_PATH ?>/assets/plugins/data-tables/DT_bootstrap.css"/>
<link rel="stylesheet" type="text/css" href="<?php echo APPLICATION_PATH ?>/assets/plugins/bootstrap-datepicker/css/datepicker.css"/>
<script type="text/javascript" src="<?php echo APPLICATION_PATH ?>/assets/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
<script type="text/javascript" src="<?php echo APPLICATION_PATH ?>/assets/plugins/select2/select2.min.js"></script>
<script type="text/javascript" src="<?php echo APPLICATION_PATH ?>/assets/plugins/data-tables/jquery.dataTables.js"></script>
<script type="text/javascript" src="<?php echo APPLICATION_PATH ?>/assets/plugins/data-tables/DT_bootstrap.js"></script>
<!-- END PAGE LEVEL PLUGINS -->
<!-- BEGIN PAGE LEVEL SCRIPTS -->
<script src="<?php echo APPLICATION_PATH ?>/assets/js/backend/core/app.js"></script>
<script type="text/javascript" src="<?php echo APPLICATION_PATH ?>/assets/plugins/bootstrap-datepicker/js/bootstrap-datepicker.js"></script>
<script type="text/javascript" src="<?php echo APPLICATION_PATH ?>/assets/plugins/select2/select2.min.js"></script>
<script type="text/javascript" src="<?php echo APPLICATION_PATH ?>/assets/plugins/data-tables/jquery.dataTables.js"></script>
<script type="text/javascript" src="<?php echo APPLICATION_PATH ?>/assets/plugins/data-tables/DT_bootstrap.js"></script>
<!-- END PAGE LEVEL PLUGINS -->
<!-- BEGIN PAGE LEVEL SCRIPTS -->
<script src="<?php echo APPLICATION_PATH ?>/assets/js/backend/core/app.js"></script>
<script>
jQuery(document).ready(function() {
jQuery(document).ready(function() {
App.init();
$("#start_day").datepicker({
......@@ -289,7 +289,7 @@
}
}
});
$('input[type="reset"]').click(function(){
$('input[type="text"]').attr('value','');
......@@ -301,12 +301,12 @@
$("#export").click(function(event){
event.preventDefault();
var param = "<?php echo http_build_query($con_arr) ?>";
window.location.href = "<?php echo site_url('admin/report/export_actions')?>?" + param ;
});
});
});
</script>
</body><!-- END BODY -->
</html>
\ No newline at end of file
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment