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

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

WBOY
Release: 2016-06-06 20:17:56
Original
1387 people have browsed it

我百度了下,发现好少关于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>
Copy after login
Copy after login

我写的那函数,到底加在哪里呢?怎么写呢?能不能加吧?还有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>
Copy after login
Copy after login

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

谢谢大神指教!

Related labels:
php
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template