src/Biz/Taxonomy/Dao/Impl/CategoryDaoImpl.php
(开头部分) 1KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
/**
* Created by PhpStorm.
* User: Simon
* Date: 12/12/2016
* Time: 17:12.
*/
namespace Biz\Taxonomy\Dao\Impl;
use Biz\Taxonomy\Dao\CategoryDao;
use Codeages\Biz\Framework\Dao\GeneralDaoImpl;
class CategoryDaoImpl extends GeneralDaoImpl implements CategoryDao
{
protected $table = 'category';
public function getByCode($code)
{
return $this->getByFields(array('code' => $code));
}
public function findByGroupId($groupId)
{
$sql = "SELECT * FROM {$this->table()} WHERE groupId = ? ORDER BY weight ASC";
return $this->db()->fetchAll($sql, array($groupId)) ?: array();
}
public function findByGroupIdAndOrgId($groupId, $orgId)
{
$sql = "SELECT * FROM {$this->table()} WHERE groupId = ? AND orgId =? ORDER BY weight ASC";
return $this->db()->fetchAll($sql, array($groupId, $orgId)) ?: array();
}
public function findByParentId($parentId, $orderBy, $start, $limit)
{
$sql = "SELECT * FROM {$this->table()} WHERE parentId = ? {$orderBy} ";
$sql = $this->sql($sql, array(), $start, $limit);
return $this->db()->fetchAll($sql, array($parentId)) ?: array();
}
public function findAllByParentId($parentId)
{
$sql = "SELECT * FROM {$this->table()} WHERE parentId = ? ORDER BY weight ASC";
return $this->db()->fetchAll($sql, array($parentId)) ?: array();
}
public function findByGroupIdAndParentId($groupId, $parentId)
{
$sql = "SELECT * FROM {$this->table()} WHERE groupId = ? AND parentId = ? ORDER BY weight ASC";
return $this->db()->fetchAll($sql, array($groupId, $parentId)) ?: array();
}
public function findCountByParentId($parentId)
{
24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明
AI 解读 AI
登录后可用,每次 10 算力,解读结果公开显示在下面。
还没有人解读过这个文件。