更新缺失代码
This commit is contained in:
parent
5335d8341e
commit
a3b21b5bca
@ -86,6 +86,21 @@ trait CategoresDao
|
||||
})->order('sort DESC,'.$this->getPk().' DESC')->select();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 获取二级分类
|
||||
* @param int $mer_id
|
||||
* @return mixed
|
||||
* @author Qinii
|
||||
*/
|
||||
public function getTwoAll($mer_id = 0,$status = null)
|
||||
{
|
||||
return $this->getModel()::getDB()->whereIn('level',[0,1])->where('mer_id', $mer_id)->when(($status !== null),function($query)use($status){
|
||||
$query->where($this->getStatus(),$status);
|
||||
})->order('sort DESC,'.$this->getPk().' DESC')->select();
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id 获取path
|
||||
* @param int $id 需要检测的数据
|
||||
|
@ -78,6 +78,12 @@ trait CategoresRepository
|
||||
}
|
||||
|
||||
|
||||
|
||||
public function getApiTwolist($merID,$status = null)
|
||||
{
|
||||
return formatCategory($this->dao->getTwoAll($merID,$status)->hidden(['path','level','mer_id','create_time'])->toArray(), $this->dao->getPk());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据ID 查询是否存在
|
||||
* @param int $merId
|
||||
|
Loading…
x
Reference in New Issue
Block a user