コード例 #1
0
 public function __construct(UserService $userService)
 {
     $this->columnModel = array(array('label' => 'Country', 'width' => 200, 'table' => 'country', 'alias' => 'country', 'id' => 'name', 'defaultValue' => null, 'searchType' => 'select', 'svalues' => $userService->getCountryListForSelectFilter()), array('label' => 'Leads', 'width' => 200, 'table' => 'clients', 'type' => 'raw', 'alias' => 'leads', 'rawValue' => 'COUNT(clients.id)', 'id' => 'lead'), array('label' => 'Customers', 'width' => 200, 'table' => 'clients', 'type' => 'raw', 'alias' => 'customers', 'rawValue' => 'COUNT(clients.id) - SUM(clients.islead)', 'id' => 'customers'), array('label' => 'Deposits Count', 'width' => 200, 'table' => 'deposits', 'type' => 'raw', 'alias' => 'dcount', 'rawValue' => 'COALESCE(deposits.dcount, 0)', 'id' => 'dcount'), array('label' => 'Deposits Amount', 'width' => 200, 'table' => 'deposits', 'type' => 'raw', 'alias' => 'damount', 'rawValue' => 'COALESCE(deposits.damount, 0)', 'id' => 'damount'), array('label' => 'FTD', 'width' => 200, 'table' => 'deposits', 'type' => 'raw', 'alias' => 'FTD', 'rawValue' => 'COALESCE(deposits.FTD, 0)', 'id' => 'FTD'));
     $this->rawQueryParamFields = array(array('field' => 'campaigns', 'type' => 'multiselect', 'sort' => false, 'queryOp' => 'inclusive', 'dbField' => 'customers.campaignId'), array('field' => 'country', 'type' => 'multiselect', 'sort' => true, 'queryOp' => 'inclusive', 'dbField' => 'customers.Country'), array('field' => 'dateRange', 'type' => 'dateRange', 'defaultValue' => Json::encode(array('start' => date(Config::get('app.dateformat')), 'end' => date(Config::get('app.dateformat')))), 'sort' => false));
     $this->url = route('country-api');
     $this->connectionName = 'so_rep';
     $this->sortname = 'damount';
     $this->postDataFields = array('campaigns' => new Expr("jQuery('#'+'%field%').val();"), 'dateRange' => new Expr("JSON.stringify(\$('#'+'%field%').daterangepicker('getRange'));"));
     $this->customNavButtons = array('exportCsv');
     parent::__construct($userService);
 }