Skip to content

Commit

Permalink
加入有线电视费
Browse files Browse the repository at this point in the history
  • Loading branch information
hivoid committed Sep 24, 2013
1 parent 438d329 commit 1823ad5
Show file tree
Hide file tree
Showing 8 changed files with 118 additions and 3 deletions.
2 changes: 1 addition & 1 deletion protected/config/main.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
'connectionString' => 'mysql:host=localhost;dbname=property_management',
'emulatePrepare' => true,
'username' => 'root',
'password' => 'techcentos',
'password' => '',
'charset' => 'utf8',
),
'errorHandler'=>array(
Expand Down
46 changes: 45 additions & 1 deletion protected/controllers/PaymentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public function actionParr()
foreach ($models as $model) {
$pk[] = $model->household_id;
}
$hcriteria->addNotInCondition('id', $pk);
$hcriteria->addNotInCondition('t.id', $pk);
}
$hcriteria->with = 'building';
$hcriteria->together = true;
Expand All @@ -171,6 +171,33 @@ public function actionParr()
));
}

public function actionCarr()
{
$criteria = new CDbCriteria();
$critical = strtotime("-1 months", strtotime('tomorrow'));
$cdate = date('Y-m-d', $critical);
$criteria->compare('date', ">= {$cdate}");
$criteria->compare('catv_costs', "> 0");
$criteria->group = 'household_id';
$criteria->select = 'household_id';
$models = PaymentRecord::model()->findAll($criteria);
$hcriteria = new CDbCriteria();
if($models)
{
$pk = array();
foreach ($models as $model) {
$pk[] = $model->household_id;
}
$hcriteria->addNotInCondition('t.id', $pk);
}
$hcriteria->with = 'building';
$hcriteria->together = true;
$dataProvider=new CActiveDataProvider('Household', array('criteria'=>$hcriteria,'pagination'=>array('pageSize'=>10, 'pageVar'=>'p')));
$this->render('cunpaid',array(
'dataProvider'=>$dataProvider,
));
}

public function actionPhistory($hid)
{
$model = Household::model()->findByPk($hid);
Expand All @@ -188,6 +215,23 @@ public function actionPhistory($hid)
}
}

public function actionChistory($hid)
{
$model = Household::model()->findByPk($hid);
if($model)
{
$criteria = new CDbCriteria();
$criteria->compare('household_id', $hid);
$criteria->compare('catv_costs', "> 0");
$criteria->order = 't.date DESC';
$dataProvider=new CActiveDataProvider('PaymentRecord', array('criteria'=>$criteria,'pagination'=>array('pageSize'=>10, 'pageVar'=>'p')));
$this->render('chistory',array(
'dataProvider'=>$dataProvider,
'model'=>$model
));
}
}

public function loadModel($id)
{
$model=PaymentRecord::model()->findByPk($id);
Expand Down
24 changes: 24 additions & 0 deletions protected/views/payment/_chview.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?php
/* @var $this PaymentController */
/* @var $data PaymentRecord */
?>

<div class="view">

<span style="color:blue;"><?php echo $data->id?></span>
&nbsp;
<b><?php echo CHtml::encode($data->getAttributeLabel('catv_costs')); ?>:</b>
<?php echo CHtml::encode($data->catv_costs); ?>
&nbsp; &nbsp;
<br />
<div style="float:right">
<div style="padding: 5px 0; font-weight:bold;">
<?php echo CHtml::encode($data->hh->building->name . ' ' . $data->hh->entrance . ' 单元 ' . $data->hh->floor . ' 层 #' . $data->hh->number); ?>
&nbsp;
</div>
<?php echo CHtml::link('查看详细', array('view', 'id'=>$data->id)); ?>
&nbsp;
<?php echo CHtml::encode($data->date); ?>
</div>
<div style="clear: both;"></div>
</div>
17 changes: 17 additions & 0 deletions protected/views/payment/_cunpaidView.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php
/* @var $this PaymentController */
/* @var $data PaymentRecord */
?>

<div class="view">

<div style="left">
<div style="padding: 5px 0; font-weight:bold;">
<?php echo CHtml::encode($data->building->name . ' ' . $data->entrance . ' 单元 ' . $data->floor . ' 层 #' . $data->number); ?>
&nbsp;
</div>
<?php echo CHtml::link('查看缴费信息', array('chistory', 'hid'=>$data->id)); ?>
<?php echo CHtml::link('查看住户信息', array('//resident/hhview', 'id'=>$data->id)); ?>
</div>
<div style="clear: both;"></div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
&nbsp;
</div>
<?php echo CHtml::link('查看缴费信息', array('phistory', 'hid'=>$data->id)); ?>
<?php echo CHtml::link('查看住户信息', array('//resident/hhview', 'id'=>$data->id)); ?>
</div>
<div style="clear: both;"></div>
</div>
15 changes: 15 additions & 0 deletions protected/views/payment/chistory.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php
/* @var $this PaymentController */
/* @var $dataProvider CActiveDataProvider */

$this->breadcrumbs=array(
'缴费'=>array('index'),
'有线电视欠费住户'=>array('parr'),
CHtml::encode($model->building->name . ' ' . $model->entrance . ' 单元 ' . $model->floor . ' 层 #' . $model->number)
);
?>
<h1><?php echo CHtml::encode($model->building->name . ' ' . $model->entrance . ' 单元 ' . $model->floor . ' 层 #' . $model->number); ?> 物业费缴费记录</h1>
<?php $this->widget('zii.widgets.CListView', array(
'dataProvider'=>$dataProvider,
'itemView'=>'_chview',
)); ?>
14 changes: 14 additions & 0 deletions protected/views/payment/cunpaid.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?php
/* @var $this PaymentController */
/* @var $dataProvider CActiveDataProvider */

$this->breadcrumbs=array(
'缴费'=>array('index'),
'有线电视欠费住户',
);
?>
<h1>有线电视欠费住户</h1>
<?php $this->widget('zii.widgets.CListView', array(
'dataProvider'=>$dataProvider,
'itemView'=>'_cunpaidView',
)); ?>
2 changes: 1 addition & 1 deletion protected/views/payment/punpaid.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
<h1>物业费欠费住户</h1>
<?php $this->widget('zii.widgets.CListView', array(
'dataProvider'=>$dataProvider,
'itemView'=>'_unpaidView',
'itemView'=>'_punpaidView',
)); ?>

0 comments on commit 1823ad5

Please sign in to comment.