ThinkPHP之ViewModel

未结帖
0 745
ajian lucy 2014-06-14
悬赏:5飞吻
<?php
namespace Admin\Model;
use Think\Model\ViewModel;

class UserViewModel extends ViewModel {
	public $viewFields = array(
		'User' => array(
			'id',
			'user_name',
			'password',
			'salt',
			'true_name',
			'police_no',
			'department_id',
			'tel',
			'traffic_level_id',
			'last_login_time',
			'last_login_ip',
			'login_count',
			'create_time',
			'create_user_id',
			'update_time',
			'update_user_id',
			'is_locked',
			'is_del',
			'_type' => 'LEFT',
		),
		'UserRole' => array(
			'role_id',
			'_on' => 'User.id=UserRole.user_id',
			'_type' => 'LEFT',
		),
		'UserPost' => array(
			'post_id',
			'_on' => 'User.id=UserPost.user_id',
			'_type' => 'LEFT',
		),
		'Department' => array(
			'name' => 'department_name',
			'cate' => 'department_cate',
			'_on' => 'User.department_id=Department.id',
			'_type' => 'LEFT',
		),
		'TrafficLevel' => array(
			'_table' => '__DICT_OPTION__',
			'name' => 'traffic_level_name',
			'_on' => 'User.traffic_level_id=TrafficLevel.id',
		),
	);
}
?>


热忱回答0


最近热帖

近期热议

  1. javascript——prototype与__proto 9
  2. Mysql 中出现的Data truncated for column 3
  3. 在nginx中使用x-sendfile的解决方案 3
  4. 高版本jQuery面插件实现Ajax上传图片 1
  5. Thinkphp Socket.class.php 类的使用 1
  6. 使用ionic3创建第一个App 0
  7. ios-oc html5 0
  8. nginx.conf 0
  9. 基于ionic3.4.0的项目搭建 0
  10. php 缩略图 0