|
|
@@ -80,6 +80,7 @@ class ApproachDeclarationForm extends Model
|
|
|
private $_orderGoods;
|
|
|
private $_standardAmount;
|
|
|
private $_decAmountStandard;
|
|
|
+ private $period;
|
|
|
|
|
|
// 批量报单时添加会员的REDIS里面缓存的添加的会员资料
|
|
|
const REDIS_WAIT_ADD_USER = 'user:dec:waitAdd';
|
|
|
@@ -740,7 +741,8 @@ class ApproachDeclarationForm extends Model
|
|
|
* @throws \yii\db\Exception
|
|
|
*/
|
|
|
public function addUser($allData){
|
|
|
- $period = Period::instance();
|
|
|
+ $periodObj = Period::instance();
|
|
|
+ $nowPeriodNum = $this->period ?: $periodObj->getNowPeriodNum();
|
|
|
// 增加会员
|
|
|
$user = new User();
|
|
|
$user->USER_NAME = $this->insertUserName;
|
|
|
@@ -772,7 +774,7 @@ class ApproachDeclarationForm extends Model
|
|
|
$user->IS_DEC = 0;
|
|
|
$user->DEC_ID = $this->_decId ?? null;
|
|
|
$user->DEC_ROLE_ID = $this->decRoleId ?? null;
|
|
|
- $user->PERIOD_AT = $period->getNowPeriodNum();
|
|
|
+ $user->PERIOD_AT = $nowPeriodNum;
|
|
|
$user->IS_DIRECT_SELLER = 0;
|
|
|
$user->VERIFIED = 1;
|
|
|
$user->VERIFIED_AT = Date::nowTime();
|
|
|
@@ -810,7 +812,7 @@ class ApproachDeclarationForm extends Model
|
|
|
*/
|
|
|
public function addDecOrder(){
|
|
|
$periodObj = Period::instance();
|
|
|
- $nowPeriodNum = $periodObj->getNowPeriodNum();
|
|
|
+ $nowPeriodNum = $this->period ?: $periodObj->getNowPeriodNum();
|
|
|
$nowCalcMonth = $periodObj->getYearMonth($nowPeriodNum);
|
|
|
|
|
|
$ord = date('Ymd').substr(implode(NULL, array_map('ord', str_split(substr(uniqid(), 7, 13), 1))), 0, 10);
|