本文整理汇总了PHP中obj::moveGoods方法的典型用法代码示例。如果您正苦于以下问题:PHP obj::moveGoods方法的具体用法?PHP obj::moveGoods怎么用?PHP obj::moveGoods使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类obj
的用法示例。
在下文中一共展示了obj::moveGoods方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delGoodsClass
/**
* 删除商品分类
*
*/
private function delGoodsClass()
{
/*权限检查*/
$this->checkAdmin('goods_class_move');
$class_id = intval($this->_input['id']);
$select_value = intval($this->_input['select']);
$productClassArray = $this->obj_goods_class->listClassDetail("");
switch ($select_value) {
case 1:
// 删除当前分类包括当前分类的子分类和商品
//查出所有子集分类
$sub_class = $this->obj_goods_class->getArrayById($productClassArray, $result, $class_id);
$sub_class[] = $class_id;
$rs = $this->obj_goods_class->delGoodsClass($sub_class, "class_id");
if ($rs) {
$rs = $this->obj_goods->delGoods($sub_class, "class_id");
if ($rs) {
$this->obj_goods_class->createGoodsClassArray();
/*日志保存*/
$log_array = array();
$log_array['log_info'] = $this->_lang['admin_goods_class_goods_del_ok'];
$this->obj_log->inLog($log_array);
$this->adminMessage($this->_lang['admin_goods_class_goods_del_ok'], $this->_configinfo['websit']['site_url'] . "/admin/admin_goods_class.php?action=list", 1, 1000);
} else {
/*日志保存*/
$log_array = array();
$log_array['log_info'] = $this->_lang['admin_goods_class_goods_del_false'];
$this->obj_log->inLog($log_array);
$this->adminMessage($this->_lang['admin_goods_class_goods_del_false'], $this->_configinfo['websit']['site_url'] . "/admin/admin_goods_class.php?action=list", 1, 1000);
}
} else {
/*日志保存*/
$log_array = array();
$log_array['log_info'] = $this->_lang['admin_goods_class_goods_del_false'];
$this->obj_log->inLog($log_array);
$this->adminMessage($this->_lang['admin_goods_class_goods_del_false'], $this->_configinfo['websit']['site_url'] . "/admin/admin_goods_class.php?action=list", 1, 1000);
}
break;
case 2:
//删除当前分类,移动子分类和商品
$class_top_id = $this->_input['txt_class_top_id' . $class_id . "_2"];
if ($class_top_id == 0) {
$this->adminMessage($this->_lang['admin_goods_class_list_select_error'], $this->_configinfo['websit']['site_url'] . "/admin/admin_goods_class.php?action=list", 1, 1000);
}
$input_param['class_top_id'] = intval($class_top_id);
$sub_one_class = $this->obj_goods_class->getArrayById($productClassArray, $result, $class_id);
/* 检查修改的分类topid是否是当前分类的下级,如果是返回错误,不是的话,正常进行 */
$sub_one_class[] = $class_id;
if ($sub_one_class != null) {
if (in_array($class_top_id, $sub_one_class)) {
$this->adminMessage($this->_lang['admin_goods_class_list_del_error1'], $this->refer_url, 1, 3000);
}
}
/* 查出下一级分类 */
$sub_one_class = array();
$sub_one_class = $this->obj_goods_class->getOneArrayById($productClassArray, $result, $class_id);
$sub_one_class_string = empty($sub_one_class) ? $class_id : @implode(",", $sub_one_class) . ',' . $class_id;
/* 移动子类 */
$update_class = $this->obj_goods_class->modifyMoreGoodsClass($input_param, array("more_id" => $sub_one_class_string));
/* 移动当前类商品 */
$update_goods = $this->obj_goods->modifyGoods($class_top_id, $class_id, "class_id", "class_id");
/* 删除当前类 */
$input['class_id'] = $class_id;
$del_goods_class = $this->obj_goods_class->delGoodsClass($input, "class_id");
if ($del_goods_class) {
$this->obj_goods_class->createGoodsClassArray();
$this->adminMessage($this->_lang['admin_goods_oper_succ'], $this->_configinfo['websit']['site_url'] . "/admin/admin_goods_class.php?action=list", 1, 1000);
}
break;
case 3:
//删除当前分类和子分类,只移动商品
$class_top_id = $this->_input['txt_class_top_id' . $class_id . "_2"];
if ($class_top_id == 0) {
$this->adminMessage($this->_lang['admin_goods_class_list_select_error'], $this->_configinfo['websit']['site_url'] . "/admin/admin_goods_class.php?action=list", 1, 1000);
}
//查出所有子集分类
$sub_class = $this->obj_goods_class->getArrayById($productClassArray, $result, $class_id);
$sub_class[] = $class_id;
/* 检查修改的分类topid是否是当前分类的下级,如果是返回错误,不是的话,正常进行 */
if ($sub_class != null) {
if (in_array($class_top_id, $sub_class)) {
$this->adminMessage($this->_lang['admin_goods_class_list_del_error'], $this->refer_url, 1, 3000);
}
}
$sub_class_string = @implode(",", $sub_class);
$rs = $this->obj_goods_class->delGoodsClass($sub_class, "class_id");
if ($rs) {
$input_param['class_id'] = $class_top_id;
$this->obj_goods->moveGoods($input_param, array("more_id" => $sub_class_string));
$this->obj_goods_class->createGoodsClassArray();
$this->adminMessage($this->_lang['admin_goods_oper_succ'], $this->_configinfo['websit']['site_url'] . "/admin/admin_goods_class.php?action=list", 1, 1000);
} else {
$this->adminMessage($this->_lang['admin_goods_oper_fill'], $this->_configinfo['websit']['site_url'] . "/admin/admin_goods_class.php?action=list", 1, 4000);
}
break;
}
//.........这里部分代码省略.........