Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2.4系 mysqlの場合で規格のNULLデータが作成されない場合があるようです #91

Open
nobuhiko opened this issue Oct 20, 2021 · 0 comments

Comments

@nobuhiko
Copy link
Collaborator

nobuhiko commented Oct 20, 2021

該当コードはここ

$i = -1;
while (($row = fgetcsv($handle)) !== false) {
// 1行目をkeyとした配列を作る
$data = $this->convertNULL(array_combine($key, $row));
// 規格がある場合,
if ($data['classcategory_id1'] != 0 && $data['classcategory_id2'] != 0) {
$data['classcategory_id1'] = 0;
$data['classcategory_id2'] = 0;
$data['status'] = 1;
$data['product_class_id'] = $i; // 苦肉の策
$add_value[$data['product_id']] = $data;
$i--;
}
}

結果商品の規格情報の編集・クリアなどが出来ないです。

SQLで修正は一応可能。(問題はある
INSERT INTO dtb_product_class (product_id, class_category_id1, class_category_id2, visible, discriminator_type,price02,create_date,update_date, sale_type_id) SELECT product_id, NULL, NULL, 0, discriminator_type,price02,create_date,update_date,sale_type_id FROM dtb_product_class WHERE class_category_id1 is not null GROUP BY product_id

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant