From 560db40e89b18f6d1802882eae97d9348334706b Mon Sep 17 00:00:00 2001 From: Guanxiying Date: Fri, 19 May 2023 16:21:04 +0800 Subject: [PATCH] * Optimize get product stats codes. --- module/program/control.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/module/program/control.php b/module/program/control.php index e3d625b66f..e14ca73dd6 100644 --- a/module/program/control.php +++ b/module/program/control.php @@ -172,6 +172,9 @@ class program extends control $this->view->program = $program; } + $products = $this->loadModel('product')->getList($programID, $browseType); + $this->view->products = $this->product->getStats(array_keys($products), $orderBy, $pager, 'story', $programID); + $this->view->title = $this->lang->program->product; $this->view->position[] = $this->lang->program->product; $this->view->programID = $programID; @@ -179,7 +182,6 @@ class program extends control $this->view->orderBy = $orderBy; $this->view->pager = $pager; $this->view->users = $this->loadModel('user')->getPairs('noletter'); - $this->view->products = $this->loadModel('product')->getStats($orderBy, $pager, $browseType, 0, 'story', $programID); $this->view->userIdPairs = $this->user->getPairs('noletter|showid'); $this->view->usersAvatar = $this->user->getAvatarPairs(''); $this->view->showBatchEdit = $this->cookie->showProductBatchEdit;