• This project
    • Loading...
  • Sign in

fe / yohobuy-node · Files

Go to a project

GitLab

  • Go to group
  • Project
  • Activity
  • Files
  • Commits
  • Pipelines 0
  • Builds 0
  • Graphs
  • Milestones
  • Issues 1
  • Merge Requests 0
  • Members
  • Labels
  • Wiki
  • Forks
  • Network
  • Create a new issue
  • yohobuy-node
  • apps
  • passport
  • models
  • cart-service.js
  • fix
    7765f000
    by htoooth
    2017-09-18 18:37:34 +0800  
    Browse Directory »
cart-service.js 424 Bytes
Raw Blame History Permalink
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
/**
 * Created by TaoHuang on 2016/9/28.
 */

'use strict';


const Api = require('./cart-api');

const _ = require('lodash');

module.exports = class extends global.yoho.BaseModel {
    constructor(ctx) {
        super(ctx);

        this.api = new Api(ctx);
    }

    goodsCount(uid, shoppingKey) {
        return this.api.goodsCount(uid, shoppingKey).then(result => _.get(result, 'data.cart_goods_count', 0));
    }
};