mirror of
https://gitee.com/fastadminnet/framework.git
synced 2026-07-08 23:52:49 +08:00
修正系统traits
This commit is contained in:
@@ -14,10 +14,9 @@ namespace traits\model;
|
|||||||
trait Adv
|
trait Adv
|
||||||
{
|
{
|
||||||
protected $optimLock = 'lock_version';
|
protected $optimLock = 'lock_version';
|
||||||
protected $returnType = 'array';
|
//protected $serializeField = [];
|
||||||
protected $serializeField = [];
|
//protected $readonlyField = [];
|
||||||
protected $readonlyField = [];
|
//protected $partition = [];
|
||||||
protected $partition = [];
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 利用__call方法重载 实现一些特殊的Model方法 (魔术方法)
|
* 利用__call方法重载 实现一些特殊的Model方法 (魔术方法)
|
||||||
@@ -219,9 +218,8 @@ trait Adv
|
|||||||
* @param string $type 返回类型 默认为数组
|
* @param string $type 返回类型 默认为数组
|
||||||
* @return mixed
|
* @return mixed
|
||||||
*/
|
*/
|
||||||
public function returnResult($data, $type = '')
|
public function returnResult($data, $type = 'array')
|
||||||
{
|
{
|
||||||
$type = $type ?: $this->returnType;
|
|
||||||
|
|
||||||
switch ($type) {
|
switch ($type) {
|
||||||
case 'array':
|
case 'array':
|
||||||
|
|||||||
@@ -15,8 +15,8 @@ use think\Lang;
|
|||||||
|
|
||||||
trait Auto
|
trait Auto
|
||||||
{
|
{
|
||||||
protected $validate = []; // 自动验证定义
|
//protected $validate = []; // 自动验证定义
|
||||||
protected $auto = []; // 自动完成定义
|
//protected $auto = []; // 自动完成定义
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建数据对象 但不保存到数据库
|
* 创建数据对象 但不保存到数据库
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ define('MANY_TO_MANY', 4);
|
|||||||
trait Relation
|
trait Relation
|
||||||
{
|
{
|
||||||
// 关联定义
|
// 关联定义
|
||||||
protected $link = [];
|
//protected $link = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 得到关联的数据表名
|
* 得到关联的数据表名
|
||||||
|
|||||||
Reference in New Issue
Block a user