diff --git a/app/common/repositories/system/CacheRepository.php b/app/common/repositories/system/CacheRepository.php index 38fcd70..167afb4 100755 --- a/app/common/repositories/system/CacheRepository.php +++ b/app/common/repositories/system/CacheRepository.php @@ -68,6 +68,8 @@ class CacheRepository extends BaseRepository const SYS_SVIP = 'sys_svip'; //预存注意事项 const LOTTERY_RULE = 'the_lottery_rule'; + //抽奖规则 + const LOTTERY_RULE2 = 'the_lottery_rule2'; public function getAgreeList($type) { @@ -76,6 +78,7 @@ class CacheRepository extends BaseRepository ['label' => '隐私政策', 'key' => self::USER_PRIVACY], ['label' => '平台规则', 'key' => self::PLATFORM_RULE], ['label' => '注销重要提示', 'key' => self::CANCELLATION_PROMPT], + ['label' => '抽奖规则', 'key' => self::LOTTERY_RULE2], ['label' => '预存注意事项', 'key' => self::LOTTERY_RULE], ]; if (!$type) { @@ -108,6 +111,7 @@ class CacheRepository extends BaseRepository self::COUPON_AGREE, self::SYS_SVIP, self::LOTTERY_RULE, + self::LOTTERY_RULE2, ]; } diff --git a/app/common/repositories/user/UserAssetsLogRepository.php b/app/common/repositories/user/UserAssetsLogRepository.php index ec39f2e..f8cf911 100644 --- a/app/common/repositories/user/UserAssetsLogRepository.php +++ b/app/common/repositories/user/UserAssetsLogRepository.php @@ -138,11 +138,8 @@ class UserAssetsLogRepository extends BaseRepository public function userRefundEvent($orderItem) { - // 更新该订单的所有数据为退款状态 - $this->dao->updateOrderStatus($orderItem['order_id'], self::STATUS_REFUND); - - $item = $this->dao->getWhere(array('id' => $orderItem)); - if($item){ + $item = $this->dao->getWhere(array('order_id' => $orderItem['order_id'])); + if ($item) { $item->status = self::STATUS_REFUND; $item->save(); } @@ -150,17 +147,18 @@ class UserAssetsLogRepository extends BaseRepository } - public function userPayEvent($groupOrder){ + public function userPayEvent($groupOrder) + { foreach ($groupOrder['orderList'] as $orderItem) { // 5. 本人使用的福利积分 if ($orderItem['integral']) { - $log = array('uid' => $orderItem['uid'], - 'asset_type' => self::ASSET_INTEGRAL, - 'type' => self::INTEGRAL_BUY, - 'status' => self::STATUS_BUY, - 'order_id' => $orderItem['order_id'], - 'count' => -$orderItem['integral'], + $log = array('uid' => $orderItem['uid'], + 'asset_type' => self::ASSET_INTEGRAL, + 'type' => self::INTEGRAL_BUY, + 'status' => self::STATUS_BUY, + 'order_id' => $orderItem['order_id'], + 'count' => -$orderItem['integral'], ); $this->addLog([$log]); $this->userAssetsRepository->updateAssets($orderItem['uid'], array('integral_buy' => -$orderItem['integral'])); @@ -317,7 +315,7 @@ class UserAssetsLogRepository extends BaseRepository $orderData = $orderRepository->orderStatisticsByUidArr($uidArr); foreach ($groupList as $group) { if ($orderData['count'] >= $group['order_count'] or $orderData['sum'] >= $group['order_sum']) { - if($group['group_id'] > $user['group_id']){ + if ($group['group_id'] > $user['group_id']) { $user['group_id'] = $group['group_id']; $user->save(); } @@ -373,7 +371,7 @@ class UserAssetsLogRepository extends BaseRepository } // 计算每个购买当前爆单商品的积分数据 - $profit = $productItem['total_price'] - $productItem['cost']*$productItem['product_num']; + $profit = $productItem['total_price'] - $productItem['cost'] * $productItem['product_num']; $where = array(); $where[] = array('product_id', '=', $productItem['product_id']); $list = $hotRepository->getList($where); @@ -574,6 +572,9 @@ class UserAssetsLogRepository extends BaseRepository if ($item['count'] > 0) { $item['count'] = "+" . $item['count']; } + if ($item['status'] == 5) { + $item['type'] .= '(退款)'; + } $user = $userRepository->get($item['uid']); if ($user) { $item['user_nickname'] = $user['nickname']; diff --git a/app/controller/api/Auth.php b/app/controller/api/Auth.php index ad544e1..9f07f33 100755 --- a/app/controller/api/Auth.php +++ b/app/controller/api/Auth.php @@ -15,6 +15,7 @@ namespace app\controller\api; use app\common\repositories\store\DepositRepository; +use app\common\repositories\system\CacheRepository; use app\common\repositories\user\DepositRecordDailyRepository; use app\common\repositories\user\LotteryRecordRepository; use app\common\repositories\store\LotteryRepository; @@ -208,7 +209,10 @@ class Auth extends BaseController public function lotteryData(){ - return app('json')->success(app(LotteryRepository::class)->getList([])); + $lotteryList = app(LotteryRepository::class)->getList([]); + $rule = app(CacheRepository::class)->getResult("the_lottery_rule2"); + + return app('json')->success(array('list' => $lotteryList, 'rule' => $rule)); } public function depositData(){ diff --git a/public/static/images/1.png b/public/static/images/1.png new file mode 100644 index 0000000..fbfa381 Binary files /dev/null and b/public/static/images/1.png differ diff --git a/public/static/images/2.png b/public/static/images/2.png new file mode 100644 index 0000000..c2c0301 Binary files /dev/null and b/public/static/images/2.png differ diff --git a/public/static/images/3.png b/public/static/images/3.png new file mode 100644 index 0000000..1a35b1a Binary files /dev/null and b/public/static/images/3.png differ diff --git a/public/static/images/prizeBg.png b/public/static/images/prizeBg.png new file mode 100644 index 0000000..93578ee Binary files /dev/null and b/public/static/images/prizeBg.png differ diff --git a/public/static/images/prizeCir.png b/public/static/images/prizeCir.png new file mode 100644 index 0000000..bfa7245 Binary files /dev/null and b/public/static/images/prizeCir.png differ diff --git a/public/static/images/prizeTitle.png b/public/static/images/prizeTitle.png new file mode 100644 index 0000000..97fcf76 Binary files /dev/null and b/public/static/images/prizeTitle.png differ diff --git a/public/static/images/start.png b/public/static/images/start.png new file mode 100644 index 0000000..4696cfa Binary files /dev/null and b/public/static/images/start.png differ