Home  >  Article  >  Backend Development  >  请问thinkphp的viewmodel可否加FIND IN SET 函数?在哪里加?可否提点下?

请问thinkphp的viewmodel可否加FIND IN SET 函数?在哪里加?可否提点下?

WBOY
WBOYOriginal
2016-06-06 20:17:561339browse

我百度了下,发现好少关于viewmodel的讲解啊

<code>public $viewFields = array(
        'Blog'=>array('id','name','title','_type'=>'LEFT'),
        'Category'=>array('title'=>'category_name','_on'=>'Category.id=Blog.category_id','_type'=>'RIGHT'),
        'User'=>array('name'=>'username','_on'=>'User.id=Blog.user_id'),
       );
       </code>

我写的那函数,到底加在哪里呢?怎么写呢?能不能加吧?还有CONCAT

谢谢大神指教!

回复内容:

我百度了下,发现好少关于viewmodel的讲解啊

<code>public $viewFields = array(
        'Blog'=>array('id','name','title','_type'=>'LEFT'),
        'Category'=>array('title'=>'category_name','_on'=>'Category.id=Blog.category_id','_type'=>'RIGHT'),
        'User'=>array('name'=>'username','_on'=>'User.id=Blog.user_id'),
       );
       </code>

我写的那函数,到底加在哪里呢?怎么写呢?能不能加吧?还有CONCAT

谢谢大神指教!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn