|
|
|
@ -44,18 +44,12 @@ class DataReport |
|
|
|
],$option); |
|
|
|
$this->_number = Order::getOrderData([ |
|
|
|
'user_type'=>'market_service',//谁取数据 user_type 用户类型
|
|
|
|
'data_type'=>'number',//取什么数据 data_type 数据类型
|
|
|
|
'market_id'=>$marketId,//取哪个市场数据
|
|
|
|
'condition'=>1,//取数据维度 condition
|
|
|
|
'user_ids'=>null |
|
|
|
],$option); |
|
|
|
$this->_count_user = Order::getOrderData([ |
|
|
|
'user_type'=>'market_service',//谁取数据 user_type 用户类型
|
|
|
|
'data_type'=>'count_user',//取什么数据 data_type 数据类型
|
|
|
|
'data_type'=>'num',//取什么数据 data_type 数据类型
|
|
|
|
'market_id'=>$marketId,//取哪个市场数据
|
|
|
|
'condition'=>1,//取数据维度 condition
|
|
|
|
'user_ids'=>null |
|
|
|
],$option); |
|
|
|
$this->_count_user = count(array_unique($this->_number)); |
|
|
|
$this->_shipping = Order::getOrderData([ |
|
|
|
'user_type'=>'market_service',//谁取数据 user_type 用户类型
|
|
|
|
'data_type'=>'shipping',//取什么数据 data_type 数据类型
|
|
|
|
@ -107,7 +101,7 @@ class DataReport |
|
|
|
->body(function (Row $row){ |
|
|
|
$row->column(2,function (Column $column){ |
|
|
|
$title = "订单数"; |
|
|
|
$value = $this->_number; |
|
|
|
$value = count($this->_number); |
|
|
|
$card = Card::make("<span style='color: #ffffff'>{$title}</span>","<span style='color: #ffffff'>{$value}</span>"); |
|
|
|
$card->style('background-color:#4e9876'); |
|
|
|
$column->row($card); |
|
|
|
@ -123,14 +117,14 @@ class DataReport |
|
|
|
|
|
|
|
$row->column(2,function (Column $column) { |
|
|
|
$title = "下单人数"; |
|
|
|
$value =$this->_count_user; |
|
|
|
$value = $this->_count_user; |
|
|
|
$card = Card::make("<span style='color: #ffffff'>{$title}</span>","<span style='color: #ffffff'>{$value}</span>"); |
|
|
|
$card->style('background-color:#4e9876'); |
|
|
|
$column->row($card); |
|
|
|
}); |
|
|
|
$row->column(2,function (Column $column){ |
|
|
|
$title = "人均单价(元)"; |
|
|
|
if ($this->_amount){ |
|
|
|
if ($this->_amount&&$this->_count_user){ |
|
|
|
$value = sprintf("%.2f",$this->_amount/$this->_count_user); |
|
|
|
}else{ |
|
|
|
$value=0; |
|
|
|
@ -174,7 +168,7 @@ class DataReport |
|
|
|
}); |
|
|
|
$row->column(4,function (Column $column){ |
|
|
|
$column->row(new Shipping($this->_shipping)); |
|
|
|
$column->row(new Distance($this->_distance,$this->_number)); |
|
|
|
$column->row(new Distance($this->_distance,count($this->_number))); |
|
|
|
$card3 = Card::make('送达时间(暂无)'); |
|
|
|
$card3->style("height:155px"); |
|
|
|
$column->row($card3); |
|
|
|
|