请问如果不止判断男和女,还判断成年与否咋整?
请问如果不止判断男和女,还判断成年与否咋整?
请问如果不止判断男和女,还判断成年与否咋整?
2017-07-06
<?php namespace app\index\model; use think\Model; class User extends Model{ public function getAdultAttr($value) { $adult = [-1=>'***',0=>'***',1=>'***',2=>'***']; return $status[$value]; } public function getAdultAttr($val) { switch($val){ case '1': return "***"; break; case '2': return "***"; break; case ~~: break; default: return "***"; break; } } } ?>
举报