在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;
}