Skip to content

Commit

Permalink
Merge pull request #4804 from k-yamamura/feature-customercsv
Browse files Browse the repository at this point in the history
会員CSVダウンロード項目にポイントを追加
  • Loading branch information
chihiro-adachi authored Dec 18, 2020
2 parents b60b4e8 + 5543014 commit c20cfdb
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
32 changes: 32 additions & 0 deletions app/DoctrineMigrations/Version20201218044542.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;

/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20201218044542 extends AbstractMigration
{
public function up(Schema $schema) : void
{
$pointExists = $this->connection->fetchColumn("SELECT COUNT(*) FROM dtb_csv WHERE csv_type_id = 2 AND field_name = 'point'");

if ($pointExists == 0) {
$sortNo = $this->connection->fetchColumn('SELECT MAX(sort_no) + 1 FROM dtb_csv WHERE csv_type_id = 2');
$this->addSql("INSERT INTO dtb_csv (
csv_type_id, creator_id, entity_name, field_name, disp_name, sort_no, enabled, create_date, update_date, discriminator_type
) VALUES (
2, null, ?, 'point', 'ポイント', $sortNo, false, CURRENT_TIMESTAMP, CURRENT_TIMESTAMP, 'csv'
)",
['Eccube\\\\Entity\\\\Customer']);
}
}

public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
}
}
1 change: 1 addition & 0 deletions src/Eccube/Resource/doctrine/import_csv/en/dtb_csv.csv
Original file line number Diff line number Diff line change
Expand Up @@ -203,3 +203,4 @@ id,csv_type_id,creator_id,entity_name,field_name,reference_field_name,disp_name,
202,5,,Eccube\\Entity\\Category,Parent,id,Parent Category ID,4,1,2017-03-07 10:14:00,2017-03-07 10:14:00,csv
203,5,,Eccube\\Entity\\Category,level,,Level,5,1,2017-03-07 10:14:00,2017-03-07 10:14:00,csv
204,1,,Eccube\\Entity\\ProductClass,TaxRule,tax_rate,Tax Rate,"31","0","2017-03-07 10:14:00","2017-03-07 10:14:00","csv"
205,2,,Eccube\\Entity\\Customer,point,,Point,32,1,2017-03-07 10:14:00,2017-03-07 10:14:00,csv
1 change: 1 addition & 0 deletions src/Eccube/Resource/doctrine/import_csv/ja/dtb_csv.csv
Original file line number Diff line number Diff line change
Expand Up @@ -203,3 +203,4 @@
"202","5",,"Eccube\\Entity\\Category","Parent","id","親カテゴリID","4","1","2017-03-07 10:14:00","2017-03-07 10:14:00","csv"
"203","5",,"Eccube\\Entity\\Category","level",,"階層","5","1","2017-03-07 10:14:00","2017-03-07 10:14:00","csv"
"204","1",,"Eccube\\Entity\\ProductClass","TaxRule","tax_rate","税率","31","0","2017-03-07 10:14:00","2017-03-07 10:14:00","csv"
"205","2",,"Eccube\\Entity\\Customer","point",,"ポイント","33","1","2017-03-07 10:14:00","2017-03-07 10:14:00","csv"

0 comments on commit c20cfdb

Please sign in to comment.