最新服务器上的版本,以后用这个
wangzhenxin
2023-11-19 bc164b8bdbfbdf1d8229a5ced6b08d7cb8db7361
导入提货卡的卡号数据时,忽略卡号为空的数据
1 files modified
12 ■■■■ changed files
plugins/exchange/forms/mall/CodeEditForm.php 12 ●●●● patch | view | raw | blame | history
plugins/exchange/forms/mall/CodeEditForm.php
@@ -129,19 +129,25 @@
            $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'=>'',