时间:2021-07-01 10:21:17 帮助过:6人阅读
class HR { function __construct(){} public static function get_emp_list($cid){//我一般用静态函数 return DB::getAll('select * from erp_employee where cid='.DB::quote($cid)); //DB为数据库操作类 } }
public function default_action(){ $hr = new HR; $empid = "S0001"; [color=#FF0000]$info = $hr->get_emp_list($empid);[/color] //[[color=#0000FF]这个怎么知道Info里有啥啊[/color]?] $args=array('arg1' => $empid,'arg2' => 'aaaaaaaaa'); //$args['empinfo'] = $info; $this->show_page('index',$args); } public function show_page($tpl,$data=null,$return=false){ if(!is_null($data) && is_array($data)){ foreach($data as $key=>$item)[code=PHP]