文件名Test_data_ssdViewModel.class.php
namespace Home\Model;
use Think\Model\ViewModel;
class Test_data_ssdViewModel extends ViewModel {
public $viewFields = array(
'Test_data_ssd'=>array('id','name'),
'Test_data_ddg'=>array('title', '_on'=>'Test_data_ssd.id=Test_data_ddg.id'),
);
}然后用的时候就会报错$Model = D("Test_data_ssdView");
$Model->field('id,title')->where('id>10')->order('id desc')->select();总是提示undefined table7 error relation ""does not exist 最佳答案