Browse Source

增加商品逻辑文件,开发定义比例转换单位类型,开发区域运费模板按比例转化数据方法,开发除去已被选取的城市,筛选剩下的城市数据方法

antshop
linyaostalker 5 years ago
parent
commit
c0f63acfa9
  1. 36
      backend/modules/shop/logic/ShopManager.php

36
backend/modules/shop/logic/ShopManager.php

@ -0,0 +1,36 @@
<?php
namespace backend\modules\shop\logic;
use Yii;
use yii\base\Exception;
class CommonManager
{
//单位类型
const UNIT_TYPE_WEIGHT = 1; //重量
const UNIT_TYPE_MONEY = 2; //金额
const UNIT_TYPE_ITEM = 3; //件
/**
* @param $type
* @param $value
* @return int
* 比例转换
*/
public static function proportionalConversion($type, $value)
{
switch ($type) {
case self::UNIT_TYPE_WEIGHT:
return 1000;
break;
case self::UNIT_TYPE_MONEY:
return 100;
break;
case self::UNIT_TYPE_ITEM:
return 1;
break;
default:
return 1;
}
}
}
Loading…
Cancel
Save