简体   繁体   English

需要在osclass表中添加新字段

[英]need to add new field in osclass table

I am working on osclass project and am stuck on one problem from last week. 我正在研究osclass项目,上周我遇到了一个问题。

I have modified oc_t_item table and added a new field called bool b_show_contactnumber . 我修改了oc_t_item表并添加了一个名为bool b_show_contactnumber的新字段。

I have added the following code in ItemActions.php 我在ItemActions.php添加了以下代码

'b_show_contactnumber'  => $aItem['showcontactNumber'],

$aItem['showcontactNumber']  = (Params::getParam('showcontactNumber') != '') ? 1 : 0;

Its not working; 它不起作用; the item is not saving. 该项目未保存。

I have checked the value of $aItem['showcontactNumber'] in the other field and value is passing. 我在另一个字段中检查了$aItem['showcontactNumber']的值,并且值正在传递。

How can I make it work? 我怎样才能使它工作?

Thanks 谢谢

First option is adding a 'Custom Field', at admin panel you can insert 'Custom Fields' like a radio buttons (SHOW CONTACT NUMB/ NO SHOW CONTACT NUMB). 第一个选项是添加“自定义字段”,在管理面板中,您可以像单选按钮一样插入“自定义字段”(显示联系号码/不显示联系号码)。

Or you can try to develop a plugin, a little guide here http://wiki.osclass.org/How_to_extend_fields . 或者你可以尝试开发一个插件,这里有一个小指南http://wiki.osclass.org/How_to_extend_fields

During the develop you can activate debugging adding some defines at config.php file , Developer section you can find Debug PHP errors & Debug SQL queries 在开发期间,您可以激活调试,在config.php文件中添加一些定义,在开发人员部分,您可以找到Debug PHP错误和调试SQL查询

If you can avoid modify the core files, you can continue updating osclass without problems. 如果您可以避免修改核心文件,则可以继续更新osclass而不会出现问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM