1
This commit is contained in:
parent
9d06cc9144
commit
a1c32e2269
@ -149,7 +149,18 @@ class Visual extends BaseController
|
|||||||
$query->limit($num);
|
$query->limit($num);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->apiSuccess('获取成功', $query->select());
|
// 农贸市场开放时间
|
||||||
|
$marketOpenTime = [
|
||||||
|
'start_time' => '7:00',
|
||||||
|
'end_time' => '19:00'
|
||||||
|
];
|
||||||
|
|
||||||
|
$result = [
|
||||||
|
'dataList' => $query->select(),
|
||||||
|
'maktetOpenTime' => $marketOpenTime
|
||||||
|
];
|
||||||
|
|
||||||
|
$this->apiSuccess('获取成功', $result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -296,6 +307,61 @@ class Visual extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 产量分析
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public function yieldAnalysis($area_id=0,$street_id=0,$village_id=0)
|
||||||
|
{
|
||||||
|
$where = [];
|
||||||
|
|
||||||
|
if ($area_id){
|
||||||
|
$where[] = ['area_id', '=', $area_id];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($street_id){
|
||||||
|
$where[] = ['street_id', '=', $street_id];
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($village_id){
|
||||||
|
$where[] = ['village_id', '=', $village_id];
|
||||||
|
}
|
||||||
|
|
||||||
|
$where[] = ['mer_type_id', '=', 7];
|
||||||
|
|
||||||
|
$m=Db::connect('shop')->table('eb_product_order_log')
|
||||||
|
->where($where)
|
||||||
|
->count();
|
||||||
|
|
||||||
|
$max=Db::connect('shop')->table('eb_product_order_log')
|
||||||
|
->where('mer_type_id',7)
|
||||||
|
->count();
|
||||||
|
|
||||||
|
if ($m!=0 && $max!=0){
|
||||||
|
|
||||||
|
$m = bcmul(bcdiv($m,$max,3),100,1);
|
||||||
|
$max=100-$m;
|
||||||
|
|
||||||
|
}else{
|
||||||
|
|
||||||
|
$m=0;
|
||||||
|
$max=0;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 覆盖人数
|
||||||
|
$number= Db::connect('shop')->table('eb_user')
|
||||||
|
->count();
|
||||||
|
|
||||||
|
$return = [
|
||||||
|
['name' => '种植','value'=>$m],
|
||||||
|
['name' => '种植总销量','value'=>$max],
|
||||||
|
];
|
||||||
|
|
||||||
|
$this->apiSuccess('获取成功', ['number' => $number, 'chanliang' => $return]);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* 电视右下角二维码
|
* 电视右下角二维码
|
||||||
|
Loading…
x
Reference in New Issue
Block a user