| | |
| | | $model = new ExchangeCode(); |
| | | $dataList = []; |
| | | foreach ($list as $k => $newItem) { |
| | | |
| | | // 当卡号为空时,跳过此条数据 |
| | | if(empty(trim($newItem['key1']))){ |
| | | continue; |
| | | } |
| | | |
| | | // 拼接需要保存的卡密数据 |
| | | $model->attributes = [ |
| | | 'mall_id' => \Yii::$app->mall->id, |
| | | 'library_id' => $this->library_id, |
| | | 'type' => 0, |
| | | 'code' => $newItem['key2'], |
| | | 'status' => $newItem['key5'], |
| | | 'code' => trim($newItem['key2']), |
| | | 'status' => trim($newItem['key5']), |
| | | 'validity_type' => 'all', |
| | | 'valid_end_time' => $this->formatExcelTime($newItem['key4']), |
| | | 'valid_start_time' => $this->formatExcelTime($newItem['key3']), |
| | | 'created_at' => date("Y-m-d H:i:s"), |
| | | 'r_user_id' => 0, |
| | | 'card_no'=> $newItem['key1'], |
| | | 'card_no'=> trim($newItem['key1']), |
| | | 'r_raffled_at'=>'0000-00-00 00:00:00', |
| | | 'r_origin'=>'', |
| | | 'name'=>'', |