@AliceXT
2016-01-05T02:40:19.000000Z
字数 1150
阅读 501
分销系统
在模型shop_product里增加一个字段
编辑模型shop_product
修改列表定义栏
插入"shangjia:上架"在倒数第二行
路径:\Addons\Shop\Controller
第18行
修改成以下代码
/**
*@author AliceXT
**/
$list_data = $this->_get_model_list ( $this->model ,0,'shangjia asc,id desc');
路径:\Addons\Diy\Widget\ShopLists\
在show函数里第58行插入
插入以下代码
/**
* @author AliceXT
**/
$map['shangjia'] = "上架";
路径:Addons\Shop\Controller
在buyNowShow函数里面第375行修改
修改成以下代码
/**
* @author AliceXT
**/
$good = M('shop_product')->where(array('id'=>$id,'shangjia'=>"上架"))->find();
/* change ending*/
在jiesuan函数
添加代码
/**
* @author AliceXT
* for 下架修改
**/
$info = json_decode($order['product_field'],true);
$pd = new ProductModel();
$pd_map['id'] = $info['id'];
$pd_info = $pd->productDetail($pd_map);
if($pd_info['shangjia'] != "上架"){
header("HTTP/1.1 424 Product is off the shelf");
echo json_encode(array("return_msg"=>"商品已下架"));
exit();
}
/* change end*/
路径:Addons\Shop\Controller
在cartList函数里
添加代码
/**
* @author AliceXT
**/
if($cell['shangjia'] != "上架"){
continue;
}
/*change end*/