|
|
@@ -200,15 +200,11 @@ class UserServiceLogic extends BaseLogic
|
|
|
public static function getServiceList(){
|
|
|
|
|
|
// //农资供应
|
|
|
- $nowYear = date('Y');
|
|
|
- $nowMonth = date('n');
|
|
|
- $date_arr = getMonthFirstAndLastDay($nowYear,$nowMonth);
|
|
|
- $lastDate = $date_arr['lastDay'];
|
|
|
- $firstDate = $date_arr['firstDay'];
|
|
|
+
|
|
|
$sdswhere = [];
|
|
|
$sdswhere[]=['sdi.status','=',2];
|
|
|
$sdswhere[]=['sdi.type','=',1];
|
|
|
- $sdswhere[]=['sdi.create_time','between',[strtotime($firstDate),strtotime($lastDate.' 23:59:59')]];
|
|
|
+
|
|
|
$SupplyInfo = SupplyDemandInfo::alias('sdi')
|
|
|
->leftJoin('supply_demand_cate sdc','sdi.cate_id = sdc.id')->field('sdi.cate_id,sdc.name,sum(number) total_num')->where($sdswhere)->group('cate_id')->select()->toArray();
|
|
|
$cate_name_arr = array_column($SupplyInfo,'name');
|
|
|
@@ -259,10 +255,18 @@ class UserServiceLogic extends BaseLogic
|
|
|
$sdswhere = [];
|
|
|
$sdswhere[]=['sdi.status','=',2];
|
|
|
$sdswhere[]=['sdi.type','=',1];
|
|
|
+
|
|
|
+ $nowYear = date('Y');
|
|
|
+ $nowMonth = date('n');
|
|
|
+ $date_arr = getMonthFirstAndLastDay($nowYear,$nowMonth);
|
|
|
+ $lastDate = $date_arr['lastDay'];
|
|
|
+ $firstDate = $date_arr['firstDay'];
|
|
|
+ $sdswhere[]=['sdi.create_time','between',[strtotime($firstDate),strtotime($lastDate.' 23:59:59')]];
|
|
|
+
|
|
|
$SupplyInfo = SupplyDemandInfo::alias('sdi')
|
|
|
->leftJoin('supply_demand_cate sdc','sdi.cate_id = sdc.id')->field('sdi.cate_id,sdc.name,sum(number) total_num')
|
|
|
->where($sdswhere)->group('cate_id')->order('total_num desc')->limit(6)->select()->toArray();
|
|
|
-
|
|
|
+
|
|
|
$cate_name_arr = array_column($SupplyInfo,'name');
|
|
|
$value_arr = array_column($SupplyInfo,'total_num');
|
|
|
|