Commit f7cebc13 authored by wwccw0591's avatar wwccw0591

temp

parent 3e2a9cbe
......@@ -7,10 +7,31 @@ use Zend\Json\Server\Exception\ErrorException;
class GoodsCommonServiceModel extends \Business\AbstractModel
{
private $goodsStorageField = 'goods_id goodsId,goods_name goodsName,goods_verify goodsVerify,goods_state goodsState,goods_image goodsImage,goods_price goodsPrice,goods_storage goodsStorage,goods_spec goodsAttr';
public function init() {
}
/**
* 获取商品库存方法
*
*/
public function getGoodsStorageList($storeId, $pageIndex = ApiConst::zero, $pageSize = ApiConst::pageSize)
{
$goodsDao=\DAO\GoodsModel::getInstance(DbNameConst::salveDBConnectName);
$where = array();
$where[] = 'store_id = '.$storeId;
$where[] = 'goods_storage<=goods_storage_alarm';
//获得列表
$datas = $goodsDao->getListPage(implode($where, ' and '), $this->goodsStorageField, $pageIndex, $pageSize);
//获得售后商品列表getOrderGoodsByRecIds
if (!empty($datas)) {
return $datas;
} else {
return new \stdClass();
}
}
/**
* 验证商品是否存在
......
......@@ -29,6 +29,27 @@ class GoodsModel extends \DAO\AbstractModel {
public function init(){
}
/**
*
* 分页获取商品列表
* @param $where
* @param $field
* @param $pageIndex
* @param $pageSize
* @param array $order
* @return array|mixed
*/
public function getListPage($where, $field, $pageIndex, $pageSize, $order = array('goods_id' => 'asc'))
{
$this->setDb($this->dbName);
if($datas = $this->lists($where, $order, $field, $pageIndex, $pageSize)) {
foreach ($datas['list'] as $key=>$val) {
$datas['list'][$key]['goodsAttr'] = $this->getFormatGoodsAttr($val['goodsAttrs']);
}
}
return $datas ? $datas : array();
}
public function getList($where,$field){
$this->setDb();
return $this->db->select($field)->from($this->_tableName)->where($where)->fetchAll();
......
......@@ -181,7 +181,7 @@ class ShopkeeperController extends \Our\Controller_AbstractApi {
/**
* 获得售后列表
*/
public function getRefunds(){
public function getRefundsAction(){
$refundService=\Business\Order\RefundServiceModel::getInstance();
$pageIndex=$this->getPageIndex();
$pageSize=$this->getPageSize();
......@@ -189,5 +189,13 @@ class ShopkeeperController extends \Our\Controller_AbstractApi {
$this->success($res);
}
/**
* 单一属性商品库存预警
*/
public function warningAction(){
$goodsCommonService = \Business\Goods\GoodsCommonServiceModel::getInstance();
$pageIndex=$this->getPageIndex();
$pageSize=$this->getPageSize();
$res = $goodsCommonService->getGoodsStorageList($this->memberId, $pageIndex, $pageSize);
}
}
......@@ -437,7 +437,6 @@ push.user.service.type=7
elastic.master.host="192.168.1.201"
elastic.master.port="9200"
elastic.master.scheme="http";
<<<<<<< HEAD
[linqing : common]
; 数据库配置
......@@ -469,6 +468,7 @@ out.config="/data/config";
;锁文件
out.locks="/data/locks";
; redis配置
password.key='~!@#$`1234qwertasdfgzxcvb'
;redis.database.params.password = "test"
;推送配置
......@@ -484,6 +484,4 @@ elastic.master.scheme="http";
;resources.database.params.hostname = "127.0.0.1"
;resources.database.params.database = "database"
;resources.database.params.username = "username"
;resources.database.params.password = "password"
=======
>>>>>>> c3e337b21d2c6cf6591e49b1be65c50fb746b2e8
;resources.database.params.password = "password"
\ No newline at end of file
......@@ -180,7 +180,6 @@ config.url.pushHost="127.0.0.1:9503";
config.url.convert="/usr/local/bin/wkhtmltoimage";
config.url.indexUrl="/www/local.qm.com/application/library/React"
config.url.libary="/www/local.qm.com/application/library"
<<<<<<< HEAD
[linqing : common]
......@@ -218,5 +217,3 @@ config.url.convert="/usr/local/bin/wkhtmltoimage";
config.url.indexUrl="/www/local.qm.com/application/library/React"
config.url.libary="/www/local.qm.com/application/library"
; 文件目录
=======
>>>>>>> c3e337b21d2c6cf6591e49b1be65c50fb746b2e8
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment