获取状态 public function getStatus(){ $sql = 'select setup from field as f,(select id as tid from module where name=\'coupons\') as t where t.tid=f.module_id and f.field=\'status\''; $res = Db::query($sql); $arr = unserialize($res[0]['setup']); $strStatus = $arr['options']; // var_dump(explode("\s",$strStatus));die(); //换行用PHP_EOL不行 $arrStatus = var_dump(preg_split('/[\s]+/',$strStatus)); return $arrStatus; }