在任何产品下添加一个字段-bugfree

在ProductService.php下修改如下方法:

    public static function getProductAllFieldInfo($type, $productId)
    {
		$accessStateArr = Yii::app()->db->createCommand()
									->select('id')
									->from('{{field_config}}')
									->where('field_name = :field_name and product_id = :product_id',
											array(':field_name'=>'AccessState',':product_id'=>$productId))
									->queryAll();
		if(empty($accessStateArr))
		{
				   Yii::app()->db->createCommand()
				  ->insert('{{field_config}}',array('created_at'=>date('Y-m-d H:i:s'),'created_by'=>1,'updated_at'=>date('Y-m-d H:i:s'),'updated_by'=>1,'field_name'=>'AccessState','field_type'=>'single select','field_value'=>'通过,不通过','default_value'=>'','is_dropped'=>'0','field_label'=>'审核状态','type'=>'bug','belong_group'=>'bug_other','display_order'=>0,'editable_action'=>'opened,resolved,closed','validate_rule'=>'no','match_expression'=>'','product_id'=>$productId,'result_group'=>'result_status','lock_version'=>1,'is_required'=>'0'));
		}
        $searchResult = Yii::app()->db->createCommand()
                        ->select('*')
                        ->from('{{field_config}}')
                        ->where('type = :type and product_id = :productId and is_dropped = :isDropped',
                                array(':type' => $type,
                                    ':productId' => $productId,
                                    ':isDropped' => CommonService::$TrueFalseStatus['FALSE']))
                        ->order('belong_group,display_order desc')
                        ->queryAll();
        return $searchResult;
    }

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值