root 3 лет назад
Родитель
Сommit
dcd06bc4e1

+ 2 - 2
backendApi/modules/v1/controllers/BonusController.php

@@ -100,9 +100,9 @@ class BonusController extends BaseController {
         $nowPeriodNum = $oriPeriodObj->getNowPeriodNum();
         $condition = $filter['condition'];
         $params = $filter['params'];
-        $condition .= ' AND PERIOD_NUM=:PERIOD_NUM';
+        // $condition .= ' AND PERIOD_NUM=:PERIOD_NUM';
         $params[':PERIOD_NUM'] = $nowPeriodNum;
-        $data = PeriodPrepare::lists($condition, $params, ['orderBy' => 'PERIOD_NUM DESC']);
+        $data = PeriodPrepare::lists($condition, $params, ['orderBy' => 'PERIOD_NUM ASC']);
         foreach ($data['list'] as $key => $value) {
            
             // 是否可生成业绩单

+ 1 - 0
common/config/main.php

@@ -1,6 +1,7 @@
 <?php
 $mainConfig = require_once __DIR__ . '/config.php';
 return [
+    'preparePerfLimit' => $configParams['preparePerfLimit'],
     'language' => 'zh-CN',
     'timeZone' => 'PRC',
     'aliases' => [

+ 12 - 0
common/models/PeriodPrepare.php

@@ -140,4 +140,16 @@ class PeriodPrepare extends \common\components\ActiveRecord
 
         return false;
     }
+
+    // 根据业绩期获取数据信息
+    public static function getInfo($periodNum) {
+        $result = PeriodPrepare::findUseSlaves()
+        ->where(
+            'PERIOD_NUM=:PERIOD_NUM ', [':PERIOD_NUM' => $periodNum]
+        )
+        ->asArray()
+        ->one();
+
+        return $result;
+    }
 }

+ 10 - 2
frontendApi/modules/v1/controllers/BonusController.php

@@ -36,6 +36,7 @@ use common\models\UserBonus;
 use common\models\UserRelation;
 use common\models\UserWallet;
 use frontendApi\modules\v1\models\User;
+use Yii;
 
 class BonusController extends BaseController {
     public $modelClass = CalcBonus::class;
@@ -108,7 +109,10 @@ class BonusController extends BaseController {
         $periodNum = $period->getNowPeriodNum();
         $month = $period->getNowYearMonth();
         // 判断是否是周日,并且是否是月结节点
-        // 判断是否是月节点
+        // 特殊要求,测试环境要去掉是否是周日的判断,周一至周日都能看.正式环境只有周日能看
+        // 读取加入到忽略文件的common/config/config.php文件内容
+        // $limit = Yii::$app->params['preparePerfLimit'];
+        // var_dump($limit);exit;
         $isCalcMonth = $period->isCalcMonth($periodNum);
         $w = date('w', time());
         if ($w != '0' || $isCalcMonth != 1) {
@@ -120,6 +124,10 @@ class BonusController extends BaseController {
             return static::notice(['user' => [],'team'=>[]]);
         }
         
+        // 获取最新的计算时间
+        $calcAt = PeriodPrepare::getInfo($periodNum);
+        $calcAt = date('Y-m-d H:i:s', $calcAt['PERF_STARTED_AT']);
+
         // 达标规则,小组底下有一个大于等于一万.或者个人情况里的合计大于等于一万
         $data = PerfMonthPrepare::getMonthPerfPrepare($userId, $month);
         // PV_PCS 个人业绩  PV_PSS 月新增团队业绩  PV_PSS_TOTAL月累计团队业绩
@@ -185,7 +193,7 @@ class BonusController extends BaseController {
             $user[0]['perf_status_name'] = '达标';
         }
         
-        return static::notice(['user' => $user,'team'=>$teamInfo]);
+        return static::notice(['user' => $user,'team'=>$teamInfo,'calcAt' => $calcAt]);
     }
 
     /**

+ 11 - 1
frontendEle/src/views/bonus/teams.vue

@@ -96,6 +96,9 @@
       </el-table-column>
 
   </el-table>
+  <el-descriptions  :column="2"  >
+  <el-descriptions-item label="最新计算时间" >{{calcTime}}</el-descriptions-item>
+</el-descriptions>
   </div>
 </template>
 
@@ -112,6 +115,7 @@
     },
     data() {
       return {
+        calcTime:'',
         userData:[],
         tableData: [],
         allData: null,
@@ -152,6 +156,7 @@
         network.getData('bonus/teams').then(response => {
           this.userData = response.user
           this.tableData = response.team
+          this.calcTime = response.calcAt
           vueObj.loading = false
         }).catch(response => {
           vueObj.loading = false
@@ -228,5 +233,10 @@
     background: #f0f9eb;
       /* color:rgb(225, 25, 98)   */
   }
-
+.el-descriptions {
+  margin-top:20px;
+}
+/deep/ .el-descriptions-item__container {
+  margin-top:10px;
+}
 </style>