后台添加产品报错Http status: 500 Internal Server Error ajaxOptions: error thrownError: Internal Server Error Exception

技术问题 · pei93 · 于 3年前 发布 · 1766 次阅读

Http status: 500 Internal Server Error
ajaxOptions: error
thrownError: Internal Server Error
Exception (Integrity constraint violation) 'yii\db\IntegrityException' with message 'SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'special_price_count' cannot be null
The SQL being executed was: INSERT INTO `product_flat` (`created_at`, `created_user_id`, `updated_at`, `name`, `spu`, `sku`, `score`, `status`, `qty`, `min_sales_qty`, `is_in_stock`, `meta_title`, `price`, `cost_price`, `special_price`, `special_from`, `special_to`, `special_price_count`, `special_price_sale_count`, `tier_price`, `final_price`, `new_product_from`, `new_product_to`, `meta_keywords`, `meta_description`, `image`, `description`, `short_description`, `remark`, `long`, `width`, `high`, `weight`, `volume_weight`, `package_number`, `relation_sku`, `buy_also_buy_sku`, `see_also_see_sku`, `attr_group`, `attr_group_info`, `brand_id`, `is_wallet_gift`, `wallet_rate`, `is_point_gift`, `point_gift_rate`, `is_point_use`, `point_use_rate`) VALUES (1595382178, 2, 1595382178, 'a:8:{s:7:\"name_zh\";s:12:\"运动配件\";s:7:\"name_en\";s:0:\"\";s:7:\"name_fr\";s:0:\"\";s:7:\"name_de\";s:0:\"\";s:7:\"name_es\";s:0:\"\";s:7:\"name_pt\";s:0:\"\";s:7:\"name_ru\";s:0:\"\";s:7:\"name_it\";s:0:\"\";}', 'aaaqd', 'ddsa', 0, 1, 99937, NULL, 1, 'a:8:{s:13:\"meta_title_zh\";s:0:\"\";s:13:\"meta_title_en\";s:0:\"\";s:13:\"meta_title_fr\";s:0:\"\";s:13:\"meta_title_de\";s:0:\"\";s:13:\"meta_title_es\";s:0:\"\";s:13:\"meta_title_pt\";s:0:\"\";s:13:\"meta_title_ru\";s:0:\"\";s:13:\"meta_title_it\";s:0:\"\";}', '0.01', '0', '0', 0, 0, NULL, NULL, 'a:0:{}', '0.01', 0, 0, 'a:8:{s:16:\"meta_keywords_zh\";s:0:\"\";s:16:\"meta_keywords_en\";s:0:\"\";s:16:\"meta_keywords_fr\";s:0:\"\";s:16:\"meta_keywords_de\";s:0:\"\";s:16:\"meta_keywords_es\";s:0:\"\";s:16:\"meta_keywords_pt\";s:0:\"\";s:16:\"meta_keywords_ru\";s:0:\"\";s:16:\"meta_keywords_it\";s:0:\"\";}', 'a:8:{s:19:\"meta_description_zh\";s:11:\"ssssadadasd\";s:19:\"meta_description_en\";s:0:\"\";s:19:\"meta_description_fr\";s:0:\"\";s:19:\"meta_description_de\";s:0:\"\";s:19:\"meta_description_es\";s:0:\"\";s:19:\"meta_description_pt\";s:0:\"\";s:19:\"meta_description_ru\";s:0:\"\";s:19:\"meta_description_it\";s:0:\"\";}', 'a:1:{s:4:\"main\";a:5:{s:5:\"image\";s:35:\"/2/ku/2kub27yfp58b9hy1595382046.png\";s:5:\"label\";s:0:\"\";s:10:\"sort_order\";s:0:\"\";s:13:\"is_thumbnails\";s:1:\"1\";s:9:\"is_detail\";s:1:\"1\";}}', 'a:8:{s:14:\"description_zh\";s:18:\"asdadadasdasdasdad\";s:14:\"description_en\";s:0:\"\";s:14:\"description_fr\";s:0:\"\";s:14:\"description_de\";s:0:\"\";s:14:\"description_es\";s:0:\"\";s:14:\"description_pt\";s:0:\"\";s:14:\"description_ru\";s:0:\"\";s:14:\"description_it\";s:0:\"\";}', 'a:8:{s:20:\"short_description_zh\";s:0:\"\";s:20:\"short_description_en\";s:0:\"\";s:20:\"short_description_fr\";s:0:\"\";s:20:\"short_description_de\";s:0:\"\";s:20:\"short_description_es\";s:0:\"\";s:20:\"short_description_pt\";s:0:\"\";s:20:\"short_description_ru\";s:0:\"\";s:20:\"short_description_it\";s:0:\"\";}', 's:0:\"\";', 0, 0, 0, '0', '0', 0, 's:0:\"\";', 's:0:\"\";', 's:0:\"\";', '运动', 'a:1:{s:12:\"运动类型\";s:6:\"配件\";}', NULL, 2, NULL, 2, NULL, 2, NULL)' 

in /www/wwwroot/www.zhouka.com/vendor/yiisoft/yii2/db/Schema.php:677

Stack trace:
#0 /www/wwwroot/www.zhouka.com/vendor/yiisoft/yii2/db/Command.php(1298): yii\db\Schema->convertException(Object(PDOException), 'INSERT INTO `pr...')
#1 /www/wwwroot/www.zhouka.com/vendor/yiisoft/yii2/db/Command.php(1093): yii\db\Command->internalExecute('INSERT INTO `pr...')
#2 /www/wwwroot/www.zhouka.com/vendor/yiisoft/yii2/db/Schema.php(432): yii\db\Command->execute()
#3 /www/wwwroot/www.zhouka.com/vendor/yiisoft/yii2/db/ActiveRecord.php(600): yii\db\Schema->insert('{{%product_flat...', Array)
#4 /www/wwwroot/www.zhouka.com/vendor/yiisoft/yii2/db/ActiveRecord.php(566): yii\db\ActiveRecord->insertInternal(NULL)
#5 /www/wwwroot/www.zhouka.com/vendor/yiisoft/yii2/db/BaseActiveRecord.php(678): yii\db\ActiveRecord->insert(true, NULL)
#6 /www/wwwroot/www.zhouka.com/vendor/fancyecommerce/fecshop/services/helper/AR.php(108): yii\db\BaseActiveRecord->save()
#7 /www/wwwroot/www.zhouka.com/vendor/fancyecommerce/fecshop/services/product/ProductMysqldb.php(497): fecshop\services\helper\AR->save(Object(fecshop\models\mysqldb\Product), Array)
#8 /www/wwwroot/www.zhouka.com/vendor/fancyecommerce/fecshop/services/Product.php(557): fecshop\services\product\ProductMysqldb->save(Array, 'catalog/product...', true)
#9 /www/wwwroot/www.zhouka.com/vendor/fancyecommerce/fecshop/app/appadmin/modules/Catalog/block/productinfo/Manageredit.php(427): fecshop\services\Product->save(Array, 'catalog/product...')
#10 /www/wwwroot/www.zhouka.com/vendor/fancyecommerce/fecshop/app/appadmin/modules/Catalog/controllers/ProductinfoController.php(111): fecshop\app\appadmin\modules\Catalog\block\productinfo\Manageredit->save()
#11 [internal function]: fecshop\app\appadmin\modules\Catalog\controllers\ProductinfoController->actionManagereditsave()
#12 /www/wwwroot/www.zhouka.com/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#13 /www/wwwroot/www.zhouka.com/vendor/yiisoft/yii2/base/Controller.php(180): yii\base\InlineAction->runWithParams(Array)
#14 /www/wwwroot/www.zhouka.com/vendor/yiisoft/yii2/base/Module.php(528): yii\base\Controller->runAction('managereditsave', Array)
#15 /www/wwwroot/www.zhouka.com/vendor/yiisoft/yii2/web/Application.php(103): yii\base\Module->runAction('catalog/product...', Array)
#16 /www/wwwroot/www.zhouka.com/vendor/yiisoft/yii2/base/Application.php(386): yii\web\Application->handleRequest(Object(yii\web\Request))
#17 /www/wwwroot/www.zhouka.com/appadmin/web/index.php(50): yii\base\Application->run()
#18 {main}

本文由 pei93 创作,采用 知识共享署名 3.0 中国大陆许可协议 进行许可。 可自由转载、引用,但需署名作者且注明文章出处。

共收到 2 条回复
select#13年前 1 个赞

" 1048 Column 'special_price_count' cannot be null",应该是‘销售特价’没填。

Fecmall#23年前 1 个赞

1.报错信息写到标题里面,方便后面的人搜索,请修改正确

2.这个是一个bug,这个字段是必填,空值报错,已经修复,待会发版

添加回复 (需要登录)
需要 登录 后方可回复, 如果你还没有账号请点击这里 注册
Your Site Analytics