'ID', 'mall_id' => 'Mall ID', 'supply_id' => 'Supply ID', 'sku_id' => 'Sku ID', 'goods_id' => 'Goods ID', 'supply_goods_id' => 'Supply Goods ID', 'attr_id' => 'Attr ID', 'is_delete' => 'Is Delete', ]; } /** * 获取一个SKUID * * @param integer $goods_id * @param integer $attr_id * @return integer */ public static function getSkuId($goods_id, $attr_id) { return self::find() ->where(['goods_id' => $goods_id, 'attr_id' => $attr_id]) ->select('sku_id') ->scalar(); } /** * 获取一个SKUID * * @param integer $goods_id * @param integer $attr_id * @return GoodsSkuModel */ public static function getSku($goods_id, $attr_id, $field = null) { $model = self::find(); $field && $model->select($field); return $model->where(['goods_id' => $goods_id, 'attr_id' => $attr_id]) ->one(); } /** * 查询 * * @param integer $mall_id * @return array */ public static function getImportedGoodsIds(int $mall_id) { return StorageModel::find() ->where(['mall_id' => $mall_id, 'is_import' => 2]) ->select(['id', 'middle_goods_id']) ->all(); } }