-
Notifications
You must be signed in to change notification settings - Fork 26
Model
李铭昕 edited this page Nov 13, 2017
·
1 revision
<?php
namespace App\Models;
use App\Models\Relation;
use App\Models\User;
class Shop extends \Phalcon\Mvc\Model{
public function initialize(){
$this->hasManyToMany(
'shop_id',
Relation::class,
'shop_id',
'user_id',
User::class,
'user_id',
[
'alias' => 'user', // 别名
'reusable' => true, // 是否可以复用对象
'params' => [
'condition'=>'is_deleted = ?0',
'bind'=>[0],
'limit' => 1
]
]
);
}
}