解决方法,导入时候发现 更新成功! - 型号: as NO.1209 就是重复model

文件位置:manager\includes\modules\category_product_listing.php

文件内容:

  if (zen_get_products_to_categories($categories->fields['categories_id'], true, 'products_active') == 'true') {
  echo '  ' . zen_image(DIR_WS_IMAGES . 'icon_yellow_on.gif', IMAGE_ICON_LINKED);
  }

函数位置: 后台\includes\functions\general.php

函数内容:

//////////////////////////////////////////////////////////

function zen_get_products_to_categories($category_id, $include_inactive = false, $counts_what = 'products') {
global $db;

$products_count = 0;
if ($include_inactive == true) {
switch ($counts_what) {
case ('products'):
$cat_products_query = "select count(*) as total
from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
where p.products_id = p2c.products_id
and p2c.categories_id = '" . (int)$category_id . "'";
break;
case ('products_active'):
$cat_products_query = "select p.products_id
from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
where p.products_id = p2c.products_id
and p2c.categories_id = '" . (int)$category_id . "'";
break;
}

} else {
switch ($counts_what) {
case ('products'):
$cat_products_query = "select count(*) as total
from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
where p.products_id = p2c.products_id
and p.products_status = 1
and p2c.categories_id = '" . (int)$category_id . "'";
break;
case ('products_active'):
$cat_products_query = "select p.products_id
from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c
where p.products_id = p2c.products_id
and p.products_status = 1
and p2c.categories_id = '" . (int)$category_id . "'";
break;
}

}
$cat_products = $db->Execute($cat_products_query);
switch ($counts_what) {
case ('products'):
$cat_products_count += $cat_products->fields['total'];
break;
case ('products_active'):
while (!$cat_products->EOF) {
if (zen_get_product_is_linked($cat_products->fields['products_id']) == 'true') {
return $products_linked = 'true';
}
$cat_products->MoveNext();
}
break;
}

$cat_child_categories_query = "select categories_id
from " . TABLE_CATEGORIES . "
where parent_id = '" . (int)$category_id . "'";

$cat_child_categories = $db->Execute($cat_child_categories_query);

if ($cat_child_categories->RecordCount() > 0) {
while (!$cat_child_categories->EOF) {
switch ($counts_what) {
case ('products'):
$cat_products_count += zen_get_products_to_categories($cat_child_categories->fields['categories_id'], $include_inactive);
break;
case ('products_active'):
if (zen_get_products_to_categories($cat_child_categories->fields['categories_id'], true, 'products_active') == 'true') {
return $products_linked = 'true';
}
break;
}
$cat_child_categories->MoveNext();
}
}

switch ($counts_what) {
case ('products'):
return $cat_products_count;
break;
case ('products_active'):
return $products_linked;
break;
}
}

zencart 后台目录产品黄色icon_yellow_on.gif 解决方案的更多相关文章

  1. encodeURIComponent编码后java后台的解码 (AJAX中文解决方案)

    encodeURIComponent编码后java后台的解码 (AJAX中文解决方案) 同学的毕业设计出现JavaScript用encodeURIComponentt编码后无法再后台解码的问题. 原来 ...

  2. dedecms(织梦)自定义表单后台显示不全 自定义模型当中添加自定义字段后在后台添加内容后不显示解决方案

    我们常用dedecms 自定义表单做留言功能.但是偶尔会遇到这样一个问题,就是 在前台提交表单后..后天显示不全.特别是中文字符  都不会显示, 比如下图: 这是因为  如果你织梦是gbk的话那就对了 ...

  3. DedeCMS找后台目录漏洞

    参考文章 https://xianzhi.aliyun.com/forum/topic/2064 近期,学习的先知社区<解决DEDECMS历史难题--找后台目录>的内容,记录一下. 利用限 ...

  4. 读DEDECMS找后台目录有感

    本文作者:红日安全团队——Mochazz 早上看了先知论坛的这篇文章:解决DEDECMS历史难题–找后台目录 不得不说作者思路确实巧妙,作者巧妙的利用了Windows FindFirstFile和织梦 ...

  5. php Laravel 框架之建立后台目录

    今天研究了在Laravel框架中的控制器中加入后台的目录.发现了一些小的规律,拿来和大家分享一下吧. 通常情况下,我们是直接在controllers目录中加入我们的控制器,然后再routes.php ...

  6. zencart后台隐藏配置菜单configuration.php?gID=6

    zencart后台隐藏配置菜单-模块选项 http://域名/后台/configuration.php?gID=6

  7. docker常用命令,及进入Tomcat的WebApps发布目录(就是进入docker容器后台目录)

    docker常用命令,及进入Tomcat的WebApps发布目录(就是进入docker容器后台目录)   一.常用命令 1.显示所有的容器,包括未运行的 docker ps -a   2.启动容器.注 ...

  8. Formily教程 | formily是中后台复杂场景的表单解决方案

    前言 formily 不是一个简单的前端轮子.Formily 是一个由阿里巴巴集团多 BU 共建的面向中后台复杂场景的表单解决方案,它也是一个表单框架.它的前身是供应链平台在 2019 年初对外开源的 ...

  9. zencart后台订单详细页显示产品图片和链接

    方法一: 找到admin/order.php 大约491行 for ($i=0, $n=sizeof($order->products); $i<$n; $i++) { 与 if (iss ...

随机推荐

  1. mysql最大连接数问题

    进入mysql系统就, 查询最大连接数:show variables like 'max_connections'; 修改最大连接数:set global max_connections=1000;

  2. C#的初步学习,心得

  3. inception cenOS 安装

    inception手册http://mysql-inception.github.io/inception-document/install/ 执行命令sh inception_build.sh,ce ...

  4. sql-yog

    sqlyog及类似工具的使用 #建表 #索引 #联合索引 #前缀索引 #表注释 #sql语句

  5. Mybatis的失误填坑-java.lang.Integer cannot be cast to java.lang.String

    Mybatis的CRUD小Demo 为方便查看每次的增删改结果,封装了查询,用来显示数据库的记录: public static void showInfo(){ SqlSession session ...

  6. Docker 安装及问题处理

    1 确定Linux版本 uname -r 2  升级系统(添加 APT 镜像源,添加使用 HTTPS 传输的软件包以及 CA 证书.) sudo apt-get update sudo apt-get ...

  7. Apache .htaccess语法之RewriteRule

    [说明]定义重写的规则[语法]RewriteRule Pattern rewritePattern [flags] # 开启 rewrite 功能 Options +FollowSymlinks Re ...

  8. 淘淘商城_day10_课堂笔记

    今日大纲 Dubbo入门学习 使用dubbo优化单点登录系统 系统间服务调用方式 浏览器直接访问 浏览器发起请求,通过ajax或jsonp方式请求: Httpclient方式 系统与系统之间通过Htt ...

  9. SSM

    今天内容安排 1:复习mybatis 2:复习springMVC 3:springMVC+spring+mybatis组合起来,搭建一个web应用开发的框架 4:用户管理系统,针对用户的CRUD操作, ...

  10. uva 12356 Army Buddies

    简单的并查集应用. #include<stdio.h> #include<string.h> #include<math.h> #include<algori ...