普通模式: 1 动态绑定模式: 1 display(); 6 } 7 8 public function index(){ 9 $user = D('User');10 $validate = array( 11... Read More
posted @ 2015-10-05 22:19 哟风 Views(805) Comments(0) Diggs(0) Edit
1 class UserModel extends RelationModel{2 protected $_link = array(3 'Profile'=> HAS_ONE, //就这一行就行了 4 );5 }注:比如这是一个人员只有一份人事档案的例子Profile... Read More
posted @ 2015-10-05 16:31 哟风 Views(241) Comments(0) Diggs(0) Edit
先分别创建三张表:test_user test_message test_user 表里有id、name字段test_message表里有id、content、uid字段然后建立一个Model 1 array( 5 'mapping_type' => BELONGS... Read More
posted @ 2015-10-05 16:29 哟风 Views(334) Comments(0) Diggs(0) Edit
先分别创建三张表:think_user think_group think_user_groupuser 表里有id、name字段group 表里有id、groupName字段user_group 表里有uid、gid字段user_group 表里的uid、gid字段都作为主键然后建立一个Model... Read More
posted @ 2015-10-05 11:11 哟风 Views(316) Comments(0) Diggs(0) Edit