liuhairui 1 жил өмнө
parent
commit
9b501c17d9

+ 21 - 12
application/api/controller/Index.php

@@ -14,6 +14,8 @@ class Index extends Controller{
 
     /**
      *近30天班组生产效率完成情况【缓存】
+     * 查询近三十天车缝小组完成情况
+     * 完成总数量
      */
     public function bzDbToRedis(){
         //存缓存Redis
@@ -21,18 +23,23 @@ class Index extends Controller{
         $redis_key = md5('bzDbToRedis');
 
         // 获取当天的日期
-        $todays = date('Y-8-d');
-        $today = date('Y-m-d');
-        // 查询设备_产量计酬表,当日班组报工产量情况,排除车缝班组,按班组和日期分组并累计数量
-        $res = db('设备_产量计酬')
-            ->alias('c')
-            ->where('c.sczl_bh', 'not like', '%车缝%') // 排除车缝班组
-            ->where('c.sys_rq', '>=', $todays . ' 00:00:00') // 当日开始时间
-            ->where('c.sys_rq', '<=', $today . ' 23:59:59') // 当日结束时间
-            ->whereNull('c.mod_rq') // 删除日期为空
-            ->field('c.sczl_bh, SUM(c.ci_num) as total_num, DATE(c.sys_rq) as date') // 班组编号,数量累计,日期
-            ->group('c.sczl_bh, DATE(c.sys_rq)') // 按班组编号和日期分组
+        $todays = date('Y-m-d');//30天前
+        $today = date('Y-m-d');//当天日期
+
+//        $where['c.sczl_bh'] = ['like','%'.'车缝'.'%'];
+        $where['mod_rq'] = null;
+        $where['工序名称'] = '车缝';
+
+        $res = db('设备_产量计酬')->alias('c')
+            ->where($where)
+            ->field('c.sczl_bh, SUM(c.数量) as 数量')
+            ->group('c.sczl_bh')
             ->select();
+//        echo "<pre>";
+//        print_r($res);
+//        echo "<pre>";die;
+
+
         $redis->set($redis_key, json_encode($res));
         echo date("Y-m-d H:i:s").'存进去了';
         return $res;
@@ -41,7 +48,7 @@ class Index extends Controller{
     /**
      *近30天班组生产效率完成情况【接口】
      */
-    public function getBzByRedis(){
+    public function bzDbTo(){
         $redis = redis();
         $row = json_decode($redis->get(md5('bzDbToRedis')), true);
         echo "<pre>";
@@ -49,6 +56,7 @@ class Index extends Controller{
         echo "<pre>";
     }
 
+
     /**
      *当日班组报工产量【缓存】
      */
@@ -218,6 +226,7 @@ class Index extends Controller{
 
     /**
      *已制单样衣未审【接口】
+     * 订单已下单 未审核数量
      */
     public function yhcjDbToRedis(){
         $redis = redis();

+ 4 - 0
application/index/controller/Index.php

@@ -15,6 +15,10 @@ class Index extends Frontend
 
     public function index()
     {
+        $this->redirect("/ReZpnAIXhw.php");   //关键代码->重定向
+
+
+
         $data =  [
             'sczl_gdbh' =>  '2310201',
             'sczl_yjno' => '1',