|
@@ -390,20 +390,19 @@ class ProductLogic extends BaseLogic |
|
@@ -390,20 +390,19 @@ class ProductLogic extends BaseLogic |
|
390
|
* @time :2023/8/9 10:17
|
390
|
* @time :2023/8/9 10:17
|
|
391
|
*/
|
391
|
*/
|
|
392
|
public function getStatusNumber(){
|
392
|
public function getStatusNumber(){
|
|
393
|
- $map = [];
|
|
|
|
394
|
//三种状态 0:草稿 1:发布 2:回收站
|
393
|
//三种状态 0:草稿 1:发布 2:回收站
|
|
395
|
$data = ['dra'=>0,'pub'=>1,'del'=>2,'tal'=>3];
|
394
|
$data = ['dra'=>0,'pub'=>1,'del'=>2,'tal'=>3];
|
|
396
|
foreach ($data as $k => $v){
|
395
|
foreach ($data as $k => $v){
|
|
397
|
- //查詢所有分類
|
396
|
+ $map = [];
|
|
398
|
$cateModel = new Category();
|
397
|
$cateModel = new Category();
|
|
399
|
$cateList = $cateModel->list(['status'=>1],'id',['id','pid']);
|
398
|
$cateList = $cateModel->list(['status'=>1],'id',['id','pid']);
|
|
400
|
$this->param['featured_status'] = $this->param['featured_status'] ?? 0;
|
399
|
$this->param['featured_status'] = $this->param['featured_status'] ?? 0;
|
|
401
|
if(!empty($cateList) && ($this->param['featured_status'] != $cateModel::STATUS_ACTIVE)){
|
400
|
if(!empty($cateList) && ($this->param['featured_status'] != $cateModel::STATUS_ACTIVE)){
|
|
402
|
- $featured_ids = $cateModel->where('title', 'like', '%Featured%')->pluck('id')->toArray();
|
401
|
+ $featured_ids = $cateModel->where('title', 'like', 'Featured%')->pluck('id')->toArray();
|
|
403
|
//获取当前的子集
|
402
|
//获取当前的子集
|
|
404
|
$featured_arr = [];
|
403
|
$featured_arr = [];
|
|
405
|
foreach ($featured_ids as $id){
|
404
|
foreach ($featured_ids as $id){
|
|
406
|
- $featured_arr = array_values(array_unique(_get_all_sub($id,$cateList)));
|
405
|
+ $featured_arr = array_merge($featured_arr,array_unique(_get_all_sub($id,$cateList)));
|
|
407
|
}
|
406
|
}
|
|
408
|
if(!empty($featured_arr)){
|
407
|
if(!empty($featured_arr)){
|
|
409
|
$cateRelated = new CategoryRelated();
|
408
|
$cateRelated = new CategoryRelated();
|