文件
mashangyoujiu/Application/Distribution/Model/StoreModel.class.php

46 行
1.7 KiB
PHP
可执行文件

<?php
namespace Distribution\Model;
/**
* 分销商品列表
* Class StoreModel
* @package Distribution\Model
*/
class StoreModel extends \Common\Model\BaseModel
{
protected $tableName = 'distribution_store';
protected $fields = array(
'id', //int(11) NOT NULL AUTO_INCREMENT,
'merchant_id', //int(11) NOT NULL DEFAULT '0' COMMENT '商户id',
'goods_id', //int(11) NOT NULL DEFAULT '0' COMMENT '商品ID',
'sale_num', //decimal(10,2) DEFAULT '0.00' COMMENT '分销数量',
'add_time', //int(11) DEFAULT '0' NULL COMMENT '添加日期',
'goods_status', //tinyint(1) DEFAULT '0' COMMENT '商品状态 0下架 1上架 2删除',
'first_proportion', //decimal(10,4) DEFAULT '0.0000' COMMENT '分销商品一级佣金比',
'second_proportion', //decimal(10,4) DEFAULT '0.0000' COMMENT '分销商品二级佣金比',
);
// 获取基本信息--商品展示
public function getDistributionGoods($where, $field, $page = 1, $limit = 10, $order = '')
{
$list = $this->alias('ds')
->join('ls_retail_goods as rg on rg.id = ds.goods_id', 'LEFT')
->field($field)
->where($where)
->order($order)
->page($page, $limit)
->select();
$total = $this->alias('ds')
->join('ls_retail_goods as rg on rg.id = ds.goods_id', 'LEFT')
->where($where)
->count();
$result['list'] = $list;
$result['count'] = $total;
return $result;
}
}