add customer ticket statistics

This commit is contained in:
2015-11-06 17:10:25 +01:00
parent b3dd9f67e8
commit 2654a501db
8 changed files with 284 additions and 23 deletions

View File

@@ -16,6 +16,7 @@ use common\components\Helper;
* @property integer $id_ticket_type
* @property integer $id_account
* @property integer $id_discount
* @property integer $id_card
* @property string $start
* @property string $end
* @property integer $max_usage_count
@@ -175,7 +176,7 @@ class Ticket extends \common\models\BaseFitnessActiveRecord
}
public static function mkStatisticQuery($start,$end){
public static function mkStatisticQuery($start,$end,$id_card = null){
// $sql = "select
// ticket_type.name,
// count(ticket.id_ticket) as total ,
@@ -211,6 +212,8 @@ class Ticket extends \common\models\BaseFitnessActiveRecord
Helper::queryAccountConstraint($query, 'ticket.id_account');
$query->andFilterWhere(['id_card' =>$id_card]);
$query->andWhere(
[
'or',