修正系统traits

This commit is contained in:
thinkphp
2016-01-02 21:46:45 +08:00
parent 3191ffda86
commit 52d368a851
3 changed files with 8 additions and 10 deletions

View File

@@ -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':

View File

@@ -15,8 +15,8 @@ use think\Lang;
trait Auto trait Auto
{ {
protected $validate = []; // 自动验证定义 //protected $validate = []; // 自动验证定义
protected $auto = []; // 自动完成定义 //protected $auto = []; // 自动完成定义
/** /**
* 创建数据对象 但不保存到数据库 * 创建数据对象 但不保存到数据库

View File

@@ -19,7 +19,7 @@ define('MANY_TO_MANY', 4);
trait Relation trait Relation
{ {
// 关联定义 // 关联定义
protected $link = []; //protected $link = [];
/** /**
* 得到关联的数据表名 * 得到关联的数据表名