|
|
@@ -20,6 +20,7 @@ use app\common\model\agricultural_machinery\UserService;
|
|
|
use app\common\service\ConfigService;
|
|
|
use app\common\service\FileService;
|
|
|
use app\common\model\recharge\RechargeOrder;
|
|
|
+use app\common\model\supply_demand\SupplyDemandInfo;
|
|
|
use app\common\model\user\User;
|
|
|
use app\common\model\article\Article;
|
|
|
use think\facade\Db;
|
|
|
@@ -72,6 +73,10 @@ class WorkbenchLogic extends BaseLogic
|
|
|
'service'=>self::service($type,$area_id),
|
|
|
];
|
|
|
}
|
|
|
+
|
|
|
+ public static function getProductionInfo($area_id,$start_time,$end_time){
|
|
|
+ return ['chat_data'=>self::production($area_id,$start_time,$end_time)];
|
|
|
+ }
|
|
|
/**
|
|
|
* @notes 常用功能
|
|
|
* @return array[]
|
|
|
@@ -305,6 +310,40 @@ class WorkbenchLogic extends BaseLogic
|
|
|
return ['type_desc'=>$type_desc,'count'=>$userCount];
|
|
|
}
|
|
|
|
|
|
+ public static function production($area_id,$start_time,$end_time){
|
|
|
+ if($area_id){
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if($start_time <> '' && $end_time <> ''){
|
|
|
+
|
|
|
+ }else{
|
|
|
+ if($start_time<>''){
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ if($end_time <> ''){
|
|
|
+
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $where = [];
|
|
|
+ $where[]=['sdi.type','=',1];
|
|
|
+ $where[]=['sdi.status','=',2];
|
|
|
+
|
|
|
+ $supply_demand_list = SupplyDemandInfo::alias('sdi')
|
|
|
+ ->leftJoin('supply_demand_cate sdc','sdc.id = sdi.cate_id')
|
|
|
+ ->field('sdi.cate_id,sdc.name,sum(sdi.number) total_num')
|
|
|
+ ->where($where)->group('sdi.cate_id')->select()->toArray();
|
|
|
+ $name = [];
|
|
|
+ $value = [] ;
|
|
|
+ if($supply_demand_list){
|
|
|
+ $name = array_column($supply_demand_list,'name');
|
|
|
+ $value = array_column($supply_demand_list,'total_num');
|
|
|
+ }
|
|
|
+ $data=['name'=>$name,'value'=>$value];
|
|
|
+ return $data;
|
|
|
+ }
|
|
|
+
|
|
|
public static function agricultural(){
|
|
|
$nowYear = date('Y');
|
|
|
$nowMonth = date('n');
|