|
|
@@ -15,6 +15,7 @@ use common\models\CalcBonusQY;
|
|
|
use common\models\EmployLevel;
|
|
|
use common\models\forms\DeclarationForm;
|
|
|
use common\models\PerfMonth;
|
|
|
+use common\models\PerfOrder;
|
|
|
use common\models\PerfPeriod;
|
|
|
use common\models\PerfStandard;
|
|
|
use common\models\Period;
|
|
|
@@ -493,14 +494,23 @@ class PushBaseDataToCalc extends BaseBusiness
|
|
|
{
|
|
|
$_offset = 0;
|
|
|
|
|
|
- perfOrder:
|
|
|
- $offset = $_offset * $this->_limit;
|
|
|
- $field = "ID,SN,DEC_TYPE, USER_ID,PV,
|
|
|
+ $field = "ID,SN,DEC_TYPE, USER_ID,PV,
|
|
|
PERIOD_NUM, CALC_MONTH,DEC_USER_ID,
|
|
|
CREATED_AT,DEC_AMOUNT as ORDER_AMOUNT,PAY_TYPE,FROM_TABLES,PAY_TYPE";
|
|
|
|
|
|
- $data = ActiveRecord::findBySql("SELECT $field from AR_PERF_ORDER where PERIOD_NUM = $this->_periodNum limit $this->_limit offset $offset;")
|
|
|
- ->asArray()->all();
|
|
|
+ $periodNum = $this->_periodNum;
|
|
|
+ $currentPeriod = Period::getInfoByPeriodNum($periodNum);
|
|
|
+ //判断是否月节点
|
|
|
+ if ($currentPeriod['IS_MONTH']) {
|
|
|
+ $periodNum = Period::getCurrentMonthPeriodByPeriodNum($periodNum);
|
|
|
+ }
|
|
|
+
|
|
|
+ //结算月
|
|
|
+ perfOrder:
|
|
|
+ $offset = $_offset * $this->_limit;
|
|
|
+ $data = PerfOrder::find()->select($field)->where(['PERIOD_NUM' => $periodNum])
|
|
|
+ ->offset($offset)->limit($this->_limit)->asArray()->all();
|
|
|
+
|
|
|
if (!empty($data)) {
|
|
|
$_offset += 1;
|
|
|
$fieldArray = array_keys(current($data));
|