|
@@ -35,11 +35,13 @@ class StoreCombinationDao extends BaseDao
|
|
|
/**
|
|
/**
|
|
|
* 搜索
|
|
* 搜索
|
|
|
* @param array $where
|
|
* @param array $where
|
|
|
|
|
+ * @param bool $search
|
|
|
* @return \crmeb\basic\BaseModel|mixed|\think\Model
|
|
* @return \crmeb\basic\BaseModel|mixed|\think\Model
|
|
|
|
|
+ * @throws \ReflectionException
|
|
|
*/
|
|
*/
|
|
|
- public function search(array $where = [])
|
|
|
|
|
|
|
+ public function search(array $where = [], bool $search = false)
|
|
|
{
|
|
{
|
|
|
- return parent::search($where)->when(isset($where['pinkIngTime']), function ($query) use ($where) {
|
|
|
|
|
|
|
+ return parent::search($where, $search)->when(isset($where['pinkIngTime']), function ($query) use ($where) {
|
|
|
$time = time();
|
|
$time = time();
|
|
|
[$startTime, $stopTime] = is_array($where['pinkIngTime']) ? $where['pinkIngTime'] : [$time, $time];
|
|
[$startTime, $stopTime] = is_array($where['pinkIngTime']) ? $where['pinkIngTime'] : [$time, $time];
|
|
|
$query->where('start_time', '<=', $startTime)->where('stop_time', '>=', $stopTime);
|
|
$query->where('start_time', '<=', $startTime)->where('stop_time', '>=', $stopTime);
|
|
@@ -100,6 +102,7 @@ class StoreCombinationDao extends BaseDao
|
|
|
$query->page($page, $limit);
|
|
$query->page($page, $limit);
|
|
|
})->order('sort desc,id desc')->select()->toArray();
|
|
})->order('sort desc,id desc')->select()->toArray();
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
/**获取列表
|
|
/**获取列表
|
|
|
* @param array $where
|
|
* @param array $where
|
|
|
* @param int $page
|
|
* @param int $page
|
|
@@ -164,6 +167,7 @@ class StoreCombinationDao extends BaseDao
|
|
|
{
|
|
{
|
|
|
return $this->search($where)->with('getPrice')->page($page, $limit)->order('sort desc,id desc')->select()->toArray();
|
|
return $this->search($where)->with('getPrice')->page($page, $limit)->order('sort desc,id desc')->select()->toArray();
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 条件获取数量
|
|
* 条件获取数量
|
|
|
* @param array $where
|
|
* @param array $where
|
|
@@ -173,6 +177,7 @@ class StoreCombinationDao extends BaseDao
|
|
|
{
|
|
{
|
|
|
return $this->search($where)->count();
|
|
return $this->search($where)->count();
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 页面设计获取商拼团列表
|
|
* 页面设计获取商拼团列表
|
|
|
* @param array $where
|
|
* @param array $where
|
|
@@ -183,9 +188,11 @@ class StoreCombinationDao extends BaseDao
|
|
|
* @throws \think\db\exception\DbException
|
|
* @throws \think\db\exception\DbException
|
|
|
* @throws \think\db\exception\ModelNotFoundException
|
|
* @throws \think\db\exception\ModelNotFoundException
|
|
|
*/
|
|
*/
|
|
|
- public function diyCombinationList(array $where, int $page, int $limit){
|
|
|
|
|
|
|
+ public function diyCombinationList(array $where, int $page, int $limit)
|
|
|
|
|
+ {
|
|
|
return $this->search($where)->with('getCategory')->page($page, $limit)->order('sort desc,id desc')->select()->toArray();
|
|
return $this->search($where)->with('getCategory')->page($page, $limit)->order('sort desc,id desc')->select()->toArray();
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 根据id获取拼团数据
|
|
* 根据id获取拼团数据
|
|
|
* @param array $ids
|
|
* @param array $ids
|