//#import $owl_mall_product_log:services/modelService.jsx

var ProductLogUtil = (function () {
    var f = {
        addProductLog: function (logType, productId, jProduct, before_state, after_state, userId, userName, remark, ip, user_agent) {
            var jLog = {};
            jLog.logType = logType;
            jLog.product_id = productId;
            jLog.before_state = before_state;
            jLog.after_state = after_state;
            jLog._orgId = jProduct._orgId;
            jLog._orgIds = jProduct._orgIds;
            jLog.uid = userId;
            jLog.uname = userName;
            jLog.remark = remark;
            jLog.ip = ip;
            jLog.ua = user_agent;

            owl_mall_product_logService.add(jLog);
        },
        getPublishStateValue: function (state) {
            if (state == "1") {
                return "上架";
            } else if (state == "0") {
                return "下架";
            }
            return "";
        },
        getCanByStateValue: function (state) {
            if (state == "1") {
                return "是";
            } else if (state == "0") {
                return "否";
            }
            return "";
        },
        getCertifyStateValue: function (state) {
            if (state == "0") {
                return "新增待审核";
            } else if (state == "1") {
                return "修改待审核";
            } else if (state == "2") {
                return "审核不通过";
            } else if (state == "3") {
                return "审核通过";
            }
            return "";
        }
    };
    return f;

})();
