Kaynağa Gözat

商家会员等级

shish 6 yıl önce
ebeveyn
işleme
142f3b38c7

+ 8 - 1
app/business/controllers/MerchantController.php

@@ -26,5 +26,12 @@ class MerchantController extends BaseController
 		$merchant = MerchantService::getInfo($this->merchant, $this->merchantExtend);
 		util::success($merchant);
 	}
-	
+
+	//商家现有的会员等级 shish 2019.12.12
+	public function actionMemberLevel()
+	{
+		$list = MerchantExtendService::getGradeList($this->merchantExtend,false,false);
+		util::success($list);
+	}
+
 }

+ 4 - 7
biz/merchant/services/MerchantExtendService.php

@@ -18,8 +18,8 @@ class MerchantExtendService extends BaseService
 		return MerchantExtendClass::getByMerchantId($id, $returnType);
 	}
 	
-	//积分等级列表 shish 2019.12.1
-	public static function getGradeList($extend, $order = 'asc')
+	//积分等级列表,带索引 shish 2019.12.1
+	public static function getGradeList($extend, $order = 'asc', $indexBy = true)
 	{
 		$gradeStr = $extend['gradeList'];
 		$data = [];
@@ -29,16 +29,13 @@ class MerchantExtendService extends BaseService
 			foreach ($arr as $key => $val) {
 				$son = explode("_", $val);
 				$discount = $son[2];
-				if (strlen($discount) == 1) {
-					$discount .= '0';
-				}
 				$data[$son[0]] = ['level' => $son[0], 'growth' => $son[1], 'discount' => $discount];
 			}
 		}
 		$data = arrayUtil::sort($data, 'level', $order);
-		return $data;
+		return $indexBy == false ? array_values($data) : $data;
 	}
-
+	
 	//运费计算方式
 	public static function getFreight($ext)
 	{

+ 7 - 0
sql.txt

@@ -1,3 +1,10 @@
+2019.12.11 shish 订单评价
+ALTER TABLE xhOrder ADD `grade` TINYINT NOT NULL DEFAULT 0 COMMENT '整体评分' AFTER `printStatus`;
+ALTER TABLE xhOrder ADD `gradeService` TINYINT NOT NULL DEFAULT 0 COMMENT '服务态度评分' AFTER `grade`;
+ALTER TABLE xhOrder ADD `gradeQuality` TINYINT NOT NULL DEFAULT 0 COMMENT '鲜花品质评分' AFTER `gradeService`;
+ALTER TABLE xhOrder ADD `gradeSend` TINYINT NOT NULL DEFAULT 0 COMMENT '配送服务评分' AFTER `gradeQuality`;
+ALTER TABLE xhOrder ADD `evaluate` VARCHAR(800) NOT NULL DEFAULT '' COMMENT '评语' AFTER `gradeSend`;
+
 2019.12.11 shish 邀请有礼表结构确定
 DROP TABLE IF EXISTS `xhInvite`;
 CREATE TABLE IF NOT EXISTS `xhInvite`(