作者 王智

修改

@@ -331,6 +331,14 @@ class Common extends Api @@ -331,6 +331,14 @@ class Common extends Api
331 ->where('invite_num', '>=', 3)->order('invite_num desc')->limit(50)->select(); 331 ->where('invite_num', '>=', 3)->order('invite_num desc')->limit(50)->select();
332 $UserId = $this->is_token($this->request->header()); 332 $UserId = $this->is_token($this->request->header());
333 $me = Db::query("SELECT b.id,b.nickname,b.avatar,b.invite_num as Num,b.rownum FROM (SELECT t.*, @rownum := @rownum + 1 AS rownum FROM (SELECT @rownum := 0) r,(SELECT * FROM fa_user ORDER BY invite_num DESC) AS t) AS b WHERE b.id={$UserId};"); 333 $me = Db::query("SELECT b.id,b.nickname,b.avatar,b.invite_num as Num,b.rownum FROM (SELECT t.*, @rownum := @rownum + 1 AS rownum FROM (SELECT @rownum := 0) r,(SELECT * FROM fa_user ORDER BY invite_num DESC) AS t) AS b WHERE b.id={$UserId};");
334 - $this->success('ok', ['list'=>$db, 'me'=>$me[0]]); 334 + $this->success('ok', ['list' => $db, 'me' => $me[0]]);
  335 + }
  336 +
  337 +
  338 + //city
  339 + public function BroCity()
  340 + {
  341 + $Info = Db::name('area')->where('pid', 0)->select();
  342 + $this->success('成功', $Info);
335 } 343 }
336 } 344 }
@@ -72,7 +72,7 @@ class Order extends Api @@ -72,7 +72,7 @@ class Order extends Api
72 //生成订单号 72 //生成订单号
73 $OrderSn = $this->order_sn(); 73 $OrderSn = $this->order_sn();
74 //计算订单总价 74 //计算订单总价
75 - $Total = $this->Total($UserId, $params['total']); 75 + $Total = $params['total'];
76 if ($params['tick_id'] != 0) { 76 if ($params['tick_id'] != 0) {
77 //更改优惠券 77 //更改优惠券
78 Db::name('user_tick')->where('user_id', $UserId)->where('id', $params['tick_id'])->update( 78 Db::name('user_tick')->where('user_id', $UserId)->where('id', $params['tick_id'])->update(
@@ -197,7 +197,7 @@ class Order extends Api @@ -197,7 +197,7 @@ class Order extends Api
197 } 197 }
198 $OrderArray = Db::name('order') 198 $OrderArray = Db::name('order')
199 ->where('user_id', $UserId) 199 ->where('user_id', $UserId)
200 - ->where('status','NEQ',6) 200 + ->where('status', 'NEQ', 6)
201 ->where($map) 201 ->where($map)
202 ->order('updatetime desc') 202 ->order('updatetime desc')
203 ->select(); 203 ->select();
@@ -300,7 +300,7 @@ class Order extends Api @@ -300,7 +300,7 @@ class Order extends Api
300 'createtime' => time() 300 'createtime' => time()
301 ]; 301 ];
302 } 302 }
303 - if($OrderInfo['water_num']!=0){ 303 + if ($OrderInfo['water_num'] != 0) {
304 Db::name('num')->insert($NumData); 304 Db::name('num')->insert($NumData);
305 } 305 }
306 //优惠券归还 306 //优惠券归还
@@ -10108,8 +10108,10 @@ class Algorithm extends Api @@ -10108,8 +10108,10 @@ class Algorithm extends Api
10108 // if ($CurrentInnateEnergyTendency[0] == $CurrentInnateEnergyTendency[1]) { 10108 // if ($CurrentInnateEnergyTendency[0] == $CurrentInnateEnergyTendency[1]) {
10109 // //两个相同的最高分值,为“排名1能量+排名2能量 主导” 10109 // //两个相同的最高分值,为“排名1能量+排名2能量 主导”
10110 // $CurrentInnate = $this->CurrentInnateName($CurrentInnateEnergyTendency[0], $CurrentInnateEnergyTendencyArray) . '+' . $this->CurrentInnateName($CurrentInnateEnergyTendency[1], $CurrentInnateEnergyTendencyArray) . '能主导'; 10110 // $CurrentInnate = $this->CurrentInnateName($CurrentInnateEnergyTendency[0], $CurrentInnateEnergyTendencyArray) . '+' . $this->CurrentInnateName($CurrentInnateEnergyTendency[1], $CurrentInnateEnergyTendencyArray) . '能主导';
10111 -  
10112 - if ($CurrentInnateEnergyTendency[0] == $CurrentInnateEnergyTendency[1] || $CurrentInnateEnergyTendency[1] == $CurrentInnateEnergyTendency[2]) { 10111 + if ($CurrentInnateEnergyTendency[0] == $CurrentInnateEnergyTendency[1] && $CurrentInnateEnergyTendency[1] == $CurrentInnateEnergyTendency[2]) {
  10112 + //三能体质
  10113 + $CurrentInnate = '三能平衡';
  10114 + } elseif ($CurrentInnateEnergyTendency[0] == $CurrentInnateEnergyTendency[1] || $CurrentInnateEnergyTendency[1] == $CurrentInnateEnergyTendency[2]) {
10113 //出现两个相同分值的特殊情况 10115 //出现两个相同分值的特殊情况
10114 if ($CurrentInnateEnergyTendency[0] == $CurrentInnateEnergyTendency[1]) { 10116 if ($CurrentInnateEnergyTendency[0] == $CurrentInnateEnergyTendency[1]) {
10115 //出现两个相同的最高分值,为“排名1能量($First)+排名2($Second)能量 主导” 10117 //出现两个相同的最高分值,为“排名1能量($First)+排名2($Second)能量 主导”
@@ -11138,7 +11140,9 @@ class Algorithm extends Api @@ -11138,7 +11140,9 @@ class Algorithm extends Api
11138 $B = $InnateEnergyTendency[1] - $InnateEnergyTendency[2]; 11140 $B = $InnateEnergyTendency[1] - $InnateEnergyTendency[2];
11139 $C = $InnateEnergyTendency[0] - $InnateEnergyTendency[1]; 11141 $C = $InnateEnergyTendency[0] - $InnateEnergyTendency[1];
11140 //判断用户天生能量倾向 $Innate 能量标签 11142 //判断用户天生能量倾向 $Innate 能量标签
11141 - if ($InnateEnergyTendency[0] == $InnateEnergyTendency[1] || $InnateEnergyTendency[1] == $InnateEnergyTendency[2]) { 11143 + if ($InnateEnergyTendency[0] == $InnateEnergyTendency[1] && $InnateEnergyTendency[1] == $InnateEnergyTendency[2]) {
  11144 + $Innate = '三能平衡';
  11145 + } elseif ($InnateEnergyTendency[0] == $InnateEnergyTendency[1] || $InnateEnergyTendency[1] == $InnateEnergyTendency[2]) {
11142 //出现两个相同分值的特殊情况 11146 //出现两个相同分值的特殊情况
11143 if ($InnateEnergyTendency[0] == $InnateEnergyTendency[1]) { 11147 if ($InnateEnergyTendency[0] == $InnateEnergyTendency[1]) {
11144 //出现两个相同的最高分值,为“排名1能量($First)+排名2($Second)能量 主导” 11148 //出现两个相同的最高分值,为“排名1能量($First)+排名2($Second)能量 主导”