This commit is contained in:
彭桃 2023-02-14 20:28:12 +08:00
parent cf81c9f4eb
commit 707f0eaf31

View File

@ -755,23 +755,30 @@ class Statistics extends BaseController
public function get_num17($area_id=0,$street_id=0,$village_id=0){ public function get_num17($area_id=0,$street_id=0,$village_id=0){
$where = []; $where = [];
if ($area_id){ if ($area_id){
$where[] = ['area_id', '=', $area_id]; $where[] = ['a.area_id', '=', $area_id];
} }
if ($street_id){ if ($street_id){
$where[] = ['street_id', '=', $street_id]; $where[] = ['a.street_id', '=', $street_id];
} }
if ($village_id){ if ($village_id){
$where[] = ['village_id', '=', $village_id]; $where[] = ['a.village_id', '=', $village_id];
} }
$return = Db::connect('shop')->table('eb_product_order_log')->alias('a')
$return = [ ->join('eb_store_product b','a.product_id = b.product_id')
['value'=>835,'name'=>'萝卜'], ->where($where)
['value'=>124,'name'=>'白菜'], ->group('a.product_id')
['value'=>187,'name'=>'芋头'], ->field("count('a.id') as value ,b.store_name as name")
['value'=>251,'name'=>'地瓜'], ->order('value desc')
['value'=>902,'name'=>'土豆'], ->limit('6')
['value'=>214,'name'=>'山药'], ->select();
]; // $return = [
// ['value'=>835,'name'=>'萝卜'],
// ['value'=>124,'name'=>'白菜'],
// ['value'=>187,'name'=>'芋头'],
// ['value'=>251,'name'=>'地瓜'],
// ['value'=>902,'name'=>'土豆'],
// ['value'=>214,'name'=>'山药'],
// ];
$this->apiSuccess('获取成功',$return); $this->apiSuccess('获取成功',$return);
} }
@ -873,197 +880,54 @@ class Statistics extends BaseController
public function get_num21($area_id=0,$street_id=0,$village_id=0){ public function get_num21($area_id=0,$street_id=0,$village_id=0){
$where = []; $where = [];
if ($area_id){ if ($area_id){
$where[] = ['area_id', '=', $area_id]; $where[] = ['a.area_id', '=', $area_id];
} }
if ($street_id){ if ($street_id){
$where[] = ['street_id', '=', $street_id]; $where[] = ['a.street_id', '=', $street_id];
} }
if ($village_id){ if ($village_id){
$where[] = ['village_id', '=', $village_id]; $where[] = ['a.village_id', '=', $village_id];
} }
$return = [ $return = Db::connect('shop')->table('eb_product_order_log')->alias('a')
[ ->join('eb_store_product b','a.product_id = b.product_id')
'name'=>'萝卜', ->where ($where)
'demand'=>7852, ->group('a.product_id')
'minnum'=> ->field("count('a.id') as value ,b.store_name as name,price,ot_price")
[['month'=>'1月','value'=>'661'], ->order('value desc')
['month'=>'2月','value'=>'356'], ->select()
['month'=>'3月','value'=>'415'], ->toarray();
['month'=>'4月','value'=>'258'], foreach ($return as $k =>$v){
['month'=>'5月','value'=>'779'], $return[$k]['demand'] = '';
['month'=>'6月','value'=>'1465'], $return[$k]['minnum'] = [
['month'=>'7月','value'=>'668'], ['month'=>'1月','value'=>0],
['month'=>'8月','value'=>'571'], ['month'=>'2月','value'=>$v['price']],
['month'=>'9月','value'=>'498'], ['month'=>'3月','value'=>0],
['month'=>'10月','value'=>'587'], ['month'=>'4月','value'=>0],
['month'=>'11月','value'=>'881'], ['month'=>'5月','value'=>0],
['month'=>'12月','value'=>'1008']], ['month'=>'6月','value'=>0],
'maxnum'=> ['month'=>'7月','value'=>0],
[['month'=>'1月','value'=>'879'], ['month'=>'8月','value'=>0],
['month'=>'2月','value'=>'521'], ['month'=>'9月','value'=>0],
['month'=>'3月','value'=>'754'], ['month'=>'10月','value'=>0],
['month'=>'4月','value'=>'369'], ['month'=>'11月','value'=>0],
['month'=>'5月','value'=>'916'], ['month'=>'12月','value'=>0]
['month'=>'6月','value'=>'1874'], ];
['month'=>'7月','value'=>'837'], $return[$k]['maxnum'] = [
['month'=>'8月','value'=>'667'], ['month'=>'1月','value'=>0],
['month'=>'9月','value'=>'547'], ['month'=>'2月','value'=>$v['ot_price']],
['month'=>'10月','value'=>'741'], ['month'=>'3月','value'=>0],
['month'=>'11月','value'=>'983'], ['month'=>'4月','value'=>0],
['month'=>'12月','value'=>'1150']], ['month'=>'5月','value'=>0],
], ['month'=>'6月','value'=>0],
[ ['month'=>'7月','value'=>0],
'name'=>'白菜', ['month'=>'8月','value'=>0],
'demand'=>8869, ['month'=>'9月','value'=>0],
'minnum'=> ['month'=>'10月','value'=>0],
[['month'=>'1月','value'=>'123'], ['month'=>'11月','value'=>0],
['month'=>'2月','value'=>'456'], ['month'=>'12月','value'=>0]
['month'=>'3月','value'=>'789'], ];
['month'=>'4月','value'=>'147'], }
['month'=>'5月','value'=>'258'],
['month'=>'6月','value'=>'369'],
['month'=>'7月','value'=>'159'],
['month'=>'8月','value'=>'267'],
['month'=>'9月','value'=>'367'],
['month'=>'10月','value'=>'541'],
['month'=>'11月','value'=>'354'],
['month'=>'12月','value'=>'897']],
'maxnum'=>
[['month'=>'1月','value'=>'879'],
['month'=>'2月','value'=>'897'],
['month'=>'3月','value'=>'1053'],
['month'=>'4月','value'=>'354'],
['month'=>'5月','value'=>'535'],
['month'=>'6月','value'=>'774'],
['month'=>'7月','value'=>'337'],
['month'=>'8月','value'=>'410'],
['month'=>'9月','value'=>'468'],
['month'=>'10月','value'=>'600'],
['month'=>'11月','value'=>'883'],
['month'=>'12月','value'=>'1100']],
],
[
'name'=>'芋头',
'demand'=>2356,
'minnum'=>
[['month'=>'1月','value'=>'245'],
['month'=>'2月','value'=>'245'],
['month'=>'3月','value'=>'411'],
['month'=>'4月','value'=>'246'],
['month'=>'5月','value'=>'631'],
['month'=>'6月','value'=>'1234'],
['month'=>'7月','value'=>'546'],
['month'=>'8月','value'=>'246'],
['month'=>'9月','value'=>'356'],
['month'=>'10月','value'=>'466'],
['month'=>'11月','value'=>'744'],
['month'=>'12月','value'=>'998']],
'maxnum'=>
[['month'=>'1月','value'=>'879'],
['month'=>'2月','value'=>'511'],
['month'=>'3月','value'=>'754'],
['month'=>'4月','value'=>'469'],
['month'=>'5月','value'=>'916'],
['month'=>'6月','value'=>'1474'],
['month'=>'7月','value'=>'887'],
['month'=>'8月','value'=>'710'],
['month'=>'9月','value'=>'678'],
['month'=>'10月','value'=>'854'],
['month'=>'11月','value'=>'983'],
['month'=>'12月','value'=>'1005']],
],
[
'name'=>'地瓜',
'demand'=>3641,
'minnum'=>
[['month'=>'1月','value'=>'255'],
['month'=>'2月','value'=>'324'],
['month'=>'3月','value'=>'124'],
['month'=>'4月','value'=>'235'],
['month'=>'5月','value'=>'364'],
['month'=>'6月','value'=>'688'],
['month'=>'7月','value'=>'678'],
['month'=>'8月','value'=>'471'],
['month'=>'9月','value'=>'468'],
['month'=>'10月','value'=>'510'],
['month'=>'11月','value'=>'789'],
['month'=>'12月','value'=>'986']],
'maxnum'=>
[['month'=>'1月','value'=>'899'],
['month'=>'2月','value'=>'531'],
['month'=>'3月','value'=>'759'],
['month'=>'4月','value'=>'569'],
['month'=>'5月','value'=>'946'],
['month'=>'6月','value'=>'1474'],
['month'=>'7月','value'=>'737'],
['month'=>'8月','value'=>'610'],
['month'=>'9月','value'=>'538'],
['month'=>'10月','value'=>'700'],
['month'=>'11月','value'=>'911'],
['month'=>'12月','value'=>'1050']],
],
[
'name'=>'土豆',
'demand'=>5345,
'minnum'=>
[['month'=>'1月','value'=>'468'],
['month'=>'2月','value'=>'315'],
['month'=>'3月','value'=>'409'],
['month'=>'4月','value'=>'268'],
['month'=>'5月','value'=>'756'],
['month'=>'6月','value'=>'1126'],
['month'=>'7月','value'=>'641'],
['month'=>'8月','value'=>'552'],
['month'=>'9月','value'=>'483'],
['month'=>'10月','value'=>'568'],
['month'=>'11月','value'=>'821'],
['month'=>'12月','value'=>'896']],
'maxnum'=>
[['month'=>'1月','value'=>'879'],
['month'=>'2月','value'=>'551'],
['month'=>'3月','value'=>'756'],
['month'=>'4月','value'=>'389'],
['month'=>'5月','value'=>'946'],
['month'=>'6月','value'=>'1474'],
['month'=>'7月','value'=>'847'],
['month'=>'8月','value'=>'720'],
['month'=>'9月','value'=>'668'],
['month'=>'10月','value'=>'830'],
['month'=>'11月','value'=>'993'],
['month'=>'12月','value'=>'1260']],
],
[
'name'=>'山药',
'demand'=>6548,
'minnum'=>
[['month'=>'1月','value'=>'578'],
['month'=>'2月','value'=>'316'],
['month'=>'3月','value'=>'409'],
['month'=>'4月','value'=>'249'],
['month'=>'5月','value'=>'789'],
['month'=>'6月','value'=>'1420'],
['month'=>'7月','value'=>'647'],
['month'=>'8月','value'=>'561'],
['month'=>'9月','value'=>'478'],
['month'=>'10月','value'=>'513'],
['month'=>'11月','value'=>'841'],
['month'=>'12月','value'=>'889']],
'maxnum'=>
[['month'=>'1月','value'=>'889'],
['month'=>'2月','value'=>'531'],
['month'=>'3月','value'=>'774'],
['month'=>'4月','value'=>'569'],
['month'=>'5月','value'=>'910'],
['month'=>'6月','value'=>'1574'],
['month'=>'7月','value'=>'857'],
['month'=>'8月','value'=>'740'],
['month'=>'9月','value'=>'648'],
['month'=>'10月','value'=>'810'],
['month'=>'11月','value'=>'983'],
['month'=>'12月','value'=>'1241']],
],
];
$this->apiSuccess('获取成功',$return); $this->apiSuccess('获取成功',$return);
} }
@ -1072,22 +936,52 @@ class Statistics extends BaseController
public function get_num22($area_id=0,$street_id=0,$village_id=0){ public function get_num22($area_id=0,$street_id=0,$village_id=0){
$where = []; $where = [];
if ($area_id){ if ($area_id){
$where[] = ['area_id', '=', $area_id]; $where[] = ['s.area_id', '=', $area_id];
} }
if ($street_id){ if ($street_id){
$where[] = ['street_id', '=', $street_id]; $where[] = ['s.street_id', '=', $street_id];
} }
if ($village_id){ if ($village_id){
$where[] = ['village_id', '=', $village_id]; $where[] = ['s.village_id', '=', $village_id];
} }
$m_7=Db::connect('shop')->table('eb_merchant_address')
->alias('s')
->where($where)
->join(['eb_merchant'=>'m'],'s.mer_id=m.mer_id and type_id=7')
->count();
$m_6=Db::connect('shop')->table('eb_merchant_address')
->alias('s')
->where($where)
->join(['eb_merchant'=>'m'],'s.mer_id=m.mer_id and type_id=6')
->count();
$m_5=Db::connect('shop')->table('eb_merchant_address')
->alias('s')
->where($where)
->join(['eb_merchant'=>'m'],'s.mer_id=m.mer_id and type_id=5')
->count();
$m_4=Db::connect('shop')->table('eb_merchant_address')
->alias('s')
->where($where)
->join(['eb_merchant'=>'m'],'s.mer_id=m.mer_id and type_id=4')
->count();
$m_3=Db::connect('shop')->table('eb_merchant_address')
->alias('s')
->where($where)
->join(['eb_merchant'=>'m'],'s.mer_id=m.mer_id and type_id=3')
->count();
$m_2=Db::connect('shop')->table('eb_merchant_address')
->alias('s')
->where($where)
->join(['eb_merchant'=>'m'],'s.mer_id=m.mer_id and type_id=2')
->count();
$return = [ $return = [
['value'=>50,'name'=>'养鸡'], ['value'=>$m_7,'name'=>'种植企业'],
['value'=>48,'name'=>'养鸭'], ['value'=>$m_6,'name'=>'养殖企业'],
['value'=>28,'name'=>'养鹅'], ['value'=>$m_5,'name'=>'加工企业'],
['value'=>10,'name'=>'养羊'], ['value'=>$m_2,'name'=>'厂家直销'],
['value'=>8,'name'=>'养虾'], ['value'=>$m_4,'name'=>'个人小店'],
['value'=>30,'name'=>'养鱼'], ['value'=>$m_3,'name'=>'旗舰店'],
]; ];
$this->apiSuccess('获取成功',$return); $this->apiSuccess('获取成功',$return);
} }
@ -1104,19 +998,60 @@ class Statistics extends BaseController
if ($village_id){ if ($village_id){
$where[] = ['village_id', '=', $village_id]; $where[] = ['village_id', '=', $village_id];
} }
$where[] = ['mer_type_id', '=', 6];
$m_1=Db::connect('shop')->table('eb_merchant_address')
->where($where)
->whereMonth('create_time', date('Y').'-01')
->count();
$m_2=Db::connect('shop')->table('eb_merchant_address')
->where($where)
->whereMonth('create_time', date('Y').'-01')
->count();
$m_3=Db::connect('shop')->table('eb_merchant_address')
->where($where)
->whereMonth('create_time', date('Y').'-01')
->count();
$m_4=Db::connect('shop')->table('eb_merchant_address')
->where($where)
->whereMonth('create_time', date('Y').'-01')
->count();
$m_5=Db::connect('shop')->table('eb_merchant_address')
->where($where)
->whereMonth('create_time', date('Y').'-01')
->count();
$m_6=Db::connect('shop')->table('eb_merchant_address')
->where($where)
->whereMonth('create_time', date('Y').'-01')
->count();
$m_7=Db::connect('shop')->table('eb_merchant_address')
->where($where)
->whereMonth('create_time', date('Y').'-01')
->count();
$m_8=Db::connect('shop')->table('eb_merchant_address')
->where($where)
->whereMonth('create_time', date('Y').'-01')
->count();
$m_9=Db::connect('shop')->table('eb_merchant_address')
->where($where)
->whereMonth('create_time', date('Y').'-01')
->count();
$m_10=Db::connect('shop')->table('eb_merchant_address')
->where($where)
->whereMonth('create_time', date('Y').'-01')
->count();
$m_11=Db::connect('shop')->table('eb_merchant_address')
->where($where)
->whereMonth('create_time', date('Y').'-01')
->count();
$m_12=Db::connect('shop')->table('eb_merchant_address')
->where($where)
->whereMonth('create_time', date('Y').'-01')
->count();
$return = [ $return = [
[ [
'name'=>'鸡', 'name'=>'产量',
'data'=>[1200,2000,1800,1560,1896,2100,1952,1635,1874,2011,1921,1932] 'data'=> [$m_1,$m_2,$m_3,$m_4,$m_5,$m_6,$m_7,$m_8,$m_9,$m_10,$m_11,$m_12]
],
[
'name'=>'鸭',
'data'=> [1124,1567,1800,1304,1596,2020,2158,1678,1999,1206,1479,2214]
],
[
'name'=>'鹅',
'data'=> [1323,756,1346,886,896,1100,952,635,874,1411,921,932]
] ]
]; ];
$this->apiSuccess('获取成功',$return); $this->apiSuccess('获取成功',$return);
@ -1134,11 +1069,12 @@ class Statistics extends BaseController
if ($village_id){ if ($village_id){
$where[] = ['village_id', '=', $village_id]; $where[] = ['village_id', '=', $village_id];
} }
$where[] = ['mer_type_id', '=', 7];
$m=Db::connect('shop')->table('eb_merchant_address')
->where($where)
->count();
$return = [ $return = [
['name' => '鸡','value'=>40], ['name' => '种植','value'=>$m],
['name' => '鸭','value'=>50],
['name' => '鹅','value'=>10],
]; ];
$this->apiSuccess('获取成功',$return); $this->apiSuccess('获取成功',$return);
} }
@ -1148,29 +1084,38 @@ class Statistics extends BaseController
public function get_num25($area_id=0,$street_id=0,$village_id=0){ public function get_num25($area_id=0,$street_id=0,$village_id=0){
$where = []; $where = [];
if ($area_id){ if ($area_id){
$where[] = ['area_id', '=', $area_id]; $where[] = ['a.area_id', '=', $area_id];
} }
if ($street_id){ if ($street_id){
$where[] = ['street_id', '=', $street_id]; $where[] = ['a.street_id', '=', $street_id];
} }
if ($village_id){ if ($village_id){
$where[] = ['village_id', '=', $village_id]; $where[] = ['a.village_id', '=', $village_id];
} }
$return['data'] = Db::connect('shop')->table('eb_product_order_log')->alias('a')
$return['data'] = [ ->join('eb_store_product b','a.product_id = b.product_id')
['name' => '土豆','value'=>90,'img'=>'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/z5.png'], ->where($where)
['name' => '番茄','value'=>34,'img'=>'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/z1.png'], ->group('a.product_id')
['name' => '红薯','value'=>64,'img'=>'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/z2.png'], ->field("count('a.id') as value ,b.store_name as name,image as img")
['name' => '山药','value'=>15,'img'=>'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/z4.png'], ->order('value desc')
['name' => '白菜','value'=>78,'img'=>'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/z3.png'], ->limit('5')
]; ->select()
$return['img'] = [ ->toarray();
'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/z5.png', $return['img'] = array_column($return['data'],'img');
'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/z1.png', // $return['data'] = [
'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/z2.png', // ['name' => '土豆','value'=>90,'img'=>'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/z5.png'],
'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/z4.png', // ['name' => '番茄','value'=>34,'img'=>'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/z1.png'],
'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/z3.png', // ['name' => '红薯','value'=>64,'img'=>'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/z2.png'],
]; // ['name' => '山药','value'=>15,'img'=>'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/z4.png'],
// ['name' => '白菜','value'=>78,'img'=>'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/z3.png'],
// ];
// $return['img'] = [
// 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/z5.png',
// 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/z1.png',
// 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/z2.png',
// 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/z4.png',
// 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/z3.png',
// ];
$this->apiSuccess('获取成功',$return); $this->apiSuccess('获取成功',$return);
} }
@ -1179,28 +1124,37 @@ class Statistics extends BaseController
public function get_num26($area_id=0,$street_id=0,$village_id=0){ public function get_num26($area_id=0,$street_id=0,$village_id=0){
$where = []; $where = [];
if ($area_id){ if ($area_id){
$where[] = ['area_id', '=', $area_id]; $where[] = ['a.area_id', '=', $area_id];
} }
if ($street_id){ if ($street_id){
$where[] = ['street_id', '=', $street_id]; $where[] = ['a.street_id', '=', $street_id];
} }
if ($village_id){ if ($village_id){
$where[] = ['village_id', '=', $village_id]; $where[] = ['a.village_id', '=', $village_id];
} }
$return = [ $return['data'] = Db::connect('shop')->table('eb_product_order_log')->alias('a')
['value'=>3.50,'name'=>'黄瓜'], ->join('eb_store_product b','a.product_id = b.product_id')
['value'=>1.60,'name'=>'白萝卜'], ->where($where)
['value'=>2.30,'name'=>'茄子'], ->group('a.product_id')
['value'=>3.50,'name'=>'西红柿'], ->field("b.store_name as name,price")
['value'=>4.50,'name'=>'长豆角'], ->limit('7')
['value'=>2.10,'name'=>'土豆'], ->select()
['value'=>2.10,'name'=>'胡萝卜'], ->toarray();
];
// $return = [
// ['value'=>3.50,'name'=>'黄瓜'],
// ['value'=>1.60,'name'=>'白萝卜'],
// ['value'=>2.30,'name'=>'茄子'],
// ['value'=>3.50,'name'=>'西红柿'],
// ['value'=>4.50,'name'=>'长豆角'],
// ['value'=>2.10,'name'=>'土豆'],
// ['value'=>2.10,'name'=>'胡萝卜'],
// ];
$this->apiSuccess('获取成功',$return); $this->apiSuccess('获取成功',$return);
} }
//新农产品市场行情 //镇公司农产品市场行情
public function get_num27($area_id=0,$street_id=0,$village_id=0){ public function get_num27($area_id=0,$street_id=0,$village_id=0){
$where = []; $where = [];
if ($area_id){ if ($area_id){
@ -1212,37 +1166,85 @@ class Statistics extends BaseController
if ($village_id){ if ($village_id){
$where[] = ['village_id', '=', $village_id]; $where[] = ['village_id', '=', $village_id];
} }
$where[] = ['mer_type_id', 'in', [6,7]];
$m_1=Db::connect('shop')->table('eb_merchant_address')
->where($where)
->whereMonth('create_time', date('Y').'-01')
->count();
$m_2=Db::connect('shop')->table('eb_merchant_address')
->where($where)
->whereMonth('create_time', date('Y').'-01')
->count();
$m_3=Db::connect('shop')->table('eb_merchant_address')
->where($where)
->whereMonth('create_time', date('Y').'-01')
->count();
$m_4=Db::connect('shop')->table('eb_merchant_address')
->where($where)
->whereMonth('create_time', date('Y').'-01')
->count();
$m_5=Db::connect('shop')->table('eb_merchant_address')
->where($where)
->whereMonth('create_time', date('Y').'-01')
->count();
$m_6=Db::connect('shop')->table('eb_merchant_address')
->where($where)
->whereMonth('create_time', date('Y').'-01')
->count();
$m_7=Db::connect('shop')->table('eb_merchant_address')
->where($where)
->whereMonth('create_time', date('Y').'-01')
->count();
$m_8=Db::connect('shop')->table('eb_merchant_address')
->where($where)
->whereMonth('create_time', date('Y').'-01')
->count();
$m_9=Db::connect('shop')->table('eb_merchant_address')
->where($where)
->whereMonth('create_time', date('Y').'-01')
->count();
$m_10=Db::connect('shop')->table('eb_merchant_address')
->where($where)
->whereMonth('create_time', date('Y').'-01')
->count();
$m_11=Db::connect('shop')->table('eb_merchant_address')
->where($where)
->whereMonth('create_time', date('Y').'-01')
->count();
$m_12=Db::connect('shop')->table('eb_merchant_address')
->where($where)
->whereMonth('create_time', date('Y').'-01')
->count();
$return = [ $return = [
[ [
'name'=>'萝卜', 'name'=>'萝卜',
'demand'=>7852, 'demand'=>7852,
'minnum'=> 'minnum'=>
[['value'=>'661'], [['value'=>$m_1],
['value'=>'356'], ['value'=>$m_2],
['value'=>'415'], ['value'=>$m_3],
['value'=>'258'], ['value'=>$m_4],
['value'=>'779'], ['value'=>$m_5],
['value'=>'1465'], ['value'=>$m_6],
['value'=>'668'], ['value'=>$m_7],
['value'=>'571'], ['value'=>$m_8],
['value'=>'498'], ['value'=>$m_9],
['value'=>'587'], ['value'=>$m_10],
['value'=>'881'], ['value'=>$m_11],
['value'=>'1008']], ['value'=>$m_12]],
'maxnum'=> 'maxnum'=>
[['value'=>'879'], [['value'=>0],
['value'=>'521'], ['value'=>0],
['value'=>'754'], ['value'=>0],
['value'=>'369'], ['value'=>0],
['value'=>'916'], ['value'=>0],
['value'=>'1874'], ['value'=>0],
['value'=>'837'], ['value'=>0],
['value'=>'667'], ['value'=>0],
['value'=>'547'], ['value'=>0],
['value'=>'741'], ['value'=>0],
['value'=>'983'], ['value'=>0],
['value'=>'1150']], ['value'=>0]],
], ],
]; ];
$this->apiSuccess('获取成功',$return); $this->apiSuccess('获取成功',$return);
@ -1252,27 +1254,37 @@ class Statistics extends BaseController
public function get_num28($area_id=0,$street_id=0,$village_id=0){ public function get_num28($area_id=0,$street_id=0,$village_id=0){
$where = []; $where = [];
if ($area_id){ if ($area_id){
$where[] = ['area_id', '=', $area_id]; $where[] = ['a.area_id', '=', $area_id];
} }
if ($street_id){ if ($street_id){
$where[] = ['street_id', '=', $street_id]; $where[] = ['a.street_id', '=', $street_id];
} }
if ($village_id){ if ($village_id){
$where[] = ['village_id', '=', $village_id]; $where[] = ['a.village_id', '=', $village_id];
} }
$return = [ $return = Db::connect('shop')->table('eb_product_order_log')->alias('a')
'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/s_baicai.png', ->join('eb_store_product b','a.product_id = b.product_id')
'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/s_dadou.png', ->where ($where)
'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/s_fanqie.png', ->group('a.product_id')
'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/s_gaoliang.png', ->field("count('a.id') as value,image")
'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/s_hongshu.png', ->order('value desc')
'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/s_huluobo.png', ->limit('10')
'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/s_qiezi.png', ->select()
'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/s_shanyao.png', ->toarray();
'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/s_tudou.png', $return = array_column($return,'image');
'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/s_xiaomai.png', // $return = [
]; // 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/s_baicai.png',
// 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/s_dadou.png',
// 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/s_fanqie.png',
// 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/s_gaoliang.png',
// 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/s_hongshu.png',
// 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/s_huluobo.png',
// 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/s_qiezi.png',
// 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/s_shanyao.png',
// 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/s_tudou.png',
// 'https://lihai001.oss-cn-chengdu.aliyuncs.com/public/kk/s_xiaomai.png',
// ];
$this->apiSuccess('获取成功',$return); $this->apiSuccess('获取成功',$return);
} }