没有继承service
临时解决:不修改库代码,拷贝一份代码到项目目录,继承service
本文由 fec123123 创作,采用 知识共享署名 3.0 中国大陆许可协议 进行许可。 可自由转载、引用,但需署名作者且注明文章出处。
已经提交修改:https://github.com/fecshop/yii2_fecshop/commit/1a70f5d40e956b2626d4fd453a2f0361882f8f99
@Terry #1楼 `php // 产品重量Kg:【必填】强制转换成float类型
`
$weight = (float)$post['weight']; if (!$weight) { $this->_error[] = '[weight] can not empty'; } else { $this->_param['weight'] = $weight; }
# 我的产品不需要重量,参数传了0。 考虑通用的情况,这里不应该用非判断
@fec123123 [[[#2楼](#comment2)](#comment2)](#comment2) OK,
1.写代码,写明文件出处,不然谁知道是那个文件?
2.这里改成与 0值做是否相等判断
0
通过内容匹配搜索,找到文件,已经更新修复:
https://github.com/fecshop/yii2_fecshop/commit/772fd0c31c5c81e37863b2c849cfa40d48e62091