Compare commits

..

No commits in common. "363c7d604ab779c7c838f667edc3a0dfafd42918" and "42750fcab9adc1831cf591bc04adfaa235cbca77" have entirely different histories.

View File

@ -73,6 +73,7 @@ class StoreProductLists extends BaseAdminDataLists implements ListsSearchInterfa
}
$class_all = $this->request->get('class_all');
if ($class_all) {
//查3级别的
if (count($class_all) == 1) {
$query->where('top_category_id', $class_all[0]);
} elseif (count($class_all) == 2) {
@ -181,19 +182,21 @@ class StoreProductLists extends BaseAdminDataLists implements ListsSearchInterfa
*/
public function count(): int
{
$query = StoreProduct::where($this->searchWhere);
$class_all = $this->request->get('class_all');
if ($class_all) {
if (count($class_all) == 1) {
$query->where('top_category_id', $class_all[0]);
} elseif (count($class_all) == 2) {
$query->where(function ($query) use ($class_all) {
$query->where('two_cate_id', $class_all[1])->whereOr('cate_id', $class_all[1]);
});
} else {
$query->where('cate_id', $class_all[2]);
$export = $this->request->get('export');
if ($export == 1) {
$class_all = $this->request->get('class_all');
if ($class_all) {
//查3级别的
$arr = Cate::where('pid', $class_all)->column('id');
if ($arr) {
$arr2 = Cate::where('pid', 'in', $arr)->column('id');
$this->searchWhere[] = ['cate_id', 'in', array_merge($arr, $arr2)];
} else {
$this->searchWhere[] = ['cate_id', '=', $class_all];
}
}
}
$query = StoreProduct::where($this->searchWhere);
if (isset($this->params['type_filter'])) {
if ($this->params['type_filter'] == 0) {
$query->where(function ($query) {