保存订单提示找不到setData方法
保存订单提示找不到setData方法
Error: Call to undefined method User\Level\Model\ResourceModel\Discount\Collection\Interceptor::setData() in D:\phpstudy_pro\WWW\asteria2\app\code\User\Level\Model\Discount.php:361
$data1 = [
'customer_id' => $customerId,
'type' => Status::COUPONS,
'point' => $couponData['points'],
'value' => str_replace(array('$', '%'), '', $couponData['title']),
'detail' => $couponData['value'],
'code' => $couponData['code'],
'style' => $couponData['type'],
'month' => date('m'),
'product_type' => $couponData['product_type'],
'activity_time' => $this->getActivityTime(),
'created' => $this->_helper->now(),
];
$discountgift =$this->_discountCollectionFactory->create();
$discountgift->setData($data1);
$discountgift->save();
这个是怎么回事呢?
admin 已回答
