Fix Enum.php#28
Open
shadylplplp wants to merge 1 commit into
Open
Conversation
修改了Enum.php中的build函数
修改
'id' => is_numeric($val) ? $text : $val,
修改成
'id' => is_string($val) ? $text : $val,
原来的判断 与文档administrator/docs/field-type-enum.md有冲突
文档中写
if the key is a string, the key will be saved to the database while the value will be presented to the user.
如果键是字符串,则键将保存到数据库中,而值将呈现给用户。
当options为
'state'=>[
'title'=>'审核',
'type'=>'enum',
'options'=>array('1'=>'未审核','2'=>'过审核','3'=>'不过审核'),
],
这种情况时 会错误判断
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修改了Enum.php中的build函数
修改
'id' => is_numeric($val) ? $text : $val,
修改成
'id' => is_string($val) ? $text : $val,
原来的判断写法 与文档administrator/docs/field-type-enum.md有冲突
文档中写
if the key is a string, the key will be saved to the database while the value will be presented to the user.
如果键是字符串,则键将保存到数据库中,而值将呈现给用户。
但当options为
'state'=>[
'title'=>'审核',
'type'=>'enum',
'options'=>array('1'=>'未审核','2'=>'过审核','3'=>'不过审核'),
],
这种情况时 会判断错误 所以更改为is_string()来做判断更为合理
渣渣第一次在github上给开源项目改代码 不知道改的对不对
请summer大佬指点谢谢