[ 'status' => 1, 'amounts' => '[]' ] ]); } function setAmountsAttr($v='',$row=[]){ if(is_array($v) || is_object($v)){ return json_encode($v,JSON_UNESCAPED_UNICODE); } if(is_string($v) && substr($v,0,1)!='['){ $v = explode(',',$v); return json_encode($v,JSON_UNESCAPED_UNICODE); } return '[]'; } function getAmountsAttr($v='',$row=[]){ if(!$v){return [];} if(is_array($v) || is_object($v)){ return $v; } return json_decode($v,true); } function getStatusList(){ return [ '0' => '禁用', '1' => '启用', ]; } }