接口修改10
This commit is contained in:
parent
9f1a87c01b
commit
43ed390805
@ -794,8 +794,18 @@ class Statistics extends BaseController
|
||||
if ($village_id){
|
||||
$where[] = ['village_id', '=', $village_id];
|
||||
}
|
||||
$find=Db::connect('shop')->table('eb_merchant_address')->where($where)->select();
|
||||
$list=[];
|
||||
if (empty($find)){
|
||||
foreach ($find as $k=>$v){
|
||||
$arr[]=$v['mer_id'];
|
||||
}
|
||||
$list = Db::connect('shop')->table('eb_broadcast_room')
|
||||
->field('room_id,name,cover_img,share_img,start_time,end_time,anchor_name,anchor_wechat,phone,live_status')
|
||||
->limit(10)
|
||||
->where('mer_id','in',$arr)->select();
|
||||
}
|
||||
|
||||
$list = Db::connect('shop')->table('eb_broadcast_room')->field('room_id,name,cover_img,share_img,start_time,end_time,anchor_name,anchor_wechat,phone,live_status')->where($where)->select();
|
||||
$this->apiSuccess('获取成功',$list);
|
||||
}
|
||||
|
||||
@ -848,8 +858,18 @@ class Statistics extends BaseController
|
||||
// 镇分佣
|
||||
$return['fenyong'] = 0;
|
||||
//总市场流量
|
||||
$return['liuliang'] = bcmul(bcdiv($z_order,$return['total_order'],2),100);
|
||||
// $return['liuliang'] = 15;
|
||||
$m=Db::connect('shop')->table('eb_product_order_log')
|
||||
->where($where)
|
||||
->where('status',1)
|
||||
|
||||
->count();
|
||||
$max=Db::connect('shop')->table('eb_product_order_log')
|
||||
->where('status',1)
|
||||
->count();
|
||||
if ($m!=0 && $max!=0){
|
||||
$m = bcmul(bcdiv($m,$max,3),100,1);
|
||||
}
|
||||
$return['liuliang'] = $m;
|
||||
$return['month'] = 12;
|
||||
// 商品销量前十
|
||||
$return['data'] = Db::connect('shop')->table('eb_store_product')
|
||||
@ -897,7 +917,7 @@ class Statistics extends BaseController
|
||||
->select()
|
||||
->toarray();
|
||||
foreach ($return as $k =>$v){
|
||||
$return[$k]['demand'] = $v['value'];
|
||||
$return[$k]['demand'] = '';
|
||||
$return[$k]['minnum'] = [
|
||||
['month'=>'1月','value'=>0],
|
||||
['month'=>'2月','value'=>$v['price']],
|
||||
@ -1072,8 +1092,20 @@ class Statistics extends BaseController
|
||||
$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;
|
||||
}
|
||||
|
||||
$return = [
|
||||
['name' => '种植','value'=>$m],
|
||||
['name' => '种植总销量','value'=>$max],
|
||||
];
|
||||
$this->apiSuccess('获取成功',$return);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user