init: import production code mss.nahaichuan.com (exclude Runtime/Uploads/backups/logs)

这个提交包含在:
Developer
2026-10-30 10:18:50 +08:00
当前提交 1f3e0ce2f6
共有 9291 个文件被更改,包括 1776674 次插入 和 0 次删除

查看文件

@@ -0,0 +1,48 @@
<?php
namespace Common\Model;
//[1.3.40]
/**
* 次卡,卡包关联商品
* Class RetailCardGoodsModel
* @package Common\Model
*/
class RetailCardGoodsModel extends BaseModel
{
protected $tableName = 'retail_card_goods';
const ID = 'id'; // `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
const MERCHANT_ID = 'merchant_id'; // `merchant_id` int(10) NOT NULL DEFAULT '0' COMMENT '商户id',
const STORE_ID = 'store_id'; // `store_id` int(10) NOT NULL DEFAULT '0' COMMENT '门店id',
const GOODS_ID = 'goods_id'; // `goods_id` int(10) NOT NULL DEFAULT '0' COMMENT '商品id',
const TYPE = 'type'; // `type` tinyint(1) NOT NULL DEFAULT '0' COMMENT '类型 0.次卡 1.卡包',
const C_ID = 'c_id'; // `c_id` int(10) NOT NULL DEFAULT '0' COMMENT '关联的次卡,卡包id',
const ADD_TIME = 'add_time'; // `add_time` varchar(15) NOT NULL DEFAULT '' COMMENT '创建时间',
const STATUS = 'status'; // `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态 0.删除 1.正常',
const SKU_ID = 'sku_id'; // `sku_id` int(10) NOT NULL DEFAULT '0' COMMENT '规格id',
const NUMBER = 'number';
/**
* 关联商品查询
*/
public function getCardGoods($map,$field = '*',$page = '',$limit = '',$order = 'c.id desc')
{
if($page || $limit){
$data = $this->alias('c')
->join('ls_retail_goods as g on c.' . self::GOODS_ID . '=g.id')
->field($field)
->where($map)
->order($order)
->page(intval($page),intval($limit))
->select();
}else{
$data = $this->alias('c')
->join('ls_retail_goods as g on c.' . self::GOODS_ID . '=g.id')
->field($field)
->where($map)
->order($order)
->select();
}
return $data;
}
}