|
|
@@ -32,30 +32,16 @@ define([ 'app/app', 'jquery-summernote' ], function(app) {
|
|
|
/**
|
|
|
* 获取销售排行信息
|
|
|
*/
|
|
|
- StoreAdsInformation.showSalesListWhenUserQuery({types: 'ORIGINAL_FACTORY'}, {}, function (data) {
|
|
|
- if (angular.isArray(data) && data.length > 0) {
|
|
|
- $scope.topSalesStores = data;
|
|
|
- angular.forEach(data, function (storeAds) {
|
|
|
- if (storeAds.store) {
|
|
|
- storeAds.uuid = storeAds.store.uuid;
|
|
|
- storeAds.logoUrl = storeAds.store.logoUrl;
|
|
|
- storeAds.storeName = storeAds.store.storeName;
|
|
|
- storeAds.description = storeAds.store.description;
|
|
|
-
|
|
|
- // 获取店铺订单数量信息
|
|
|
- Order.countOneStoreOrder({storeUuid : storeAds.store.uuid}, {}, function (data) {
|
|
|
- storeAds.orderCount = data.orderCount || 0;
|
|
|
- }, function () {
|
|
|
- storeAds.orderCount = 0;
|
|
|
- });
|
|
|
- }
|
|
|
+ StoreInfo.findTopStoreBySales({ isOriginal: true }, {}, function (stores) {
|
|
|
+ $scope.topSalesStores = stores || [];
|
|
|
+ angular.forEach($scope.topSalesStores, function (store) {
|
|
|
+ Order.countOneStoreOrder({storeUuid : store.uuid}, {}, function (data) {
|
|
|
+ store.orderCount = data.orderCount || 0;
|
|
|
+ }, function () {
|
|
|
+ store.orderCount = 0;
|
|
|
});
|
|
|
- } else {
|
|
|
- $scope.topSalesStores = [];
|
|
|
- }
|
|
|
- }, function (error) {
|
|
|
- console.log(error);
|
|
|
- $scope.topSalesStores = [];
|
|
|
+ });
|
|
|
+ }, function (resp) {
|
|
|
});
|
|
|
|
|
|
/**
|