main
home.fengxinyhyl 9 months ago
parent e5dc34f01c
commit 0d76d0846d
  1. 26
      app/common/dao/store/LotteryRecordDao.php
  2. 30
      app/common/model/store/LotteryRecord.php
  3. 68
      app/common/repositories/store/LotteryRecordRepository.php
  4. 16
      app/common/repositories/store/LotteryRepository.php
  5. 15
      app/common/repositories/user/UserAssetsRepository.php
  6. 91
      app/controller/admin/system/Lottery.php
  7. 33
      app/controller/api/Auth.php
  8. 2
      public/system.html
  9. 1
      public/system/css/app.6bc454a6.css
  10. 1
      public/system/css/chunk-0076aee0.1994cfaf.css
  11. 1
      public/system/css/chunk-00f82344.43ba0500.css
  12. 1
      public/system/css/chunk-01480f32.808f46fc.css
  13. 1
      public/system/css/chunk-040b499e.d41b0061.css
  14. 1
      public/system/css/chunk-0554be4a.4577ae2d.css
  15. 1
      public/system/css/chunk-06ec00c6.6cefcfff.css
  16. 1
      public/system/css/chunk-07cd2417.91b50e69.css
  17. 1
      public/system/css/chunk-084815e6.83467d60.css
  18. 1
      public/system/css/chunk-09c49cb3.a67dada0.css
  19. 1
      public/system/css/chunk-0ba19fa5.7a71a884.css
  20. 1
      public/system/css/chunk-0dfdbfa4.383535f3.css
  21. 1
      public/system/css/chunk-0e225e05.3d1e6267.css
  22. 1
      public/system/css/chunk-0e639411.28453efc.css
  23. 1
      public/system/css/chunk-0ee5ab49.fc5397b2.css
  24. 1
      public/system/css/chunk-101a9de9.d6bfd377.css
  25. 1
      public/system/css/chunk-105d3b44.f3e0bca6.css
  26. 1
      public/system/css/chunk-1111fbac.52e3cb76.css
  27. 1
      public/system/css/chunk-12abd954.39e409fc.css
  28. 1
      public/system/css/chunk-133a950e.bcd58563.css
  29. 1
      public/system/css/chunk-134c202f.13e72b12.css
  30. 1
      public/system/css/chunk-13693bd6.39655eb3.css
  31. 1
      public/system/css/chunk-159adc28.ee222e16.css
  32. 1
      public/system/css/chunk-15d92a8a.4d0980d8.css
  33. 1
      public/system/css/chunk-15f3e05e.50378406.css
  34. 1
      public/system/css/chunk-1804e030.1d51fc11.css
  35. 1
      public/system/css/chunk-196bc26a.f7225220.css
  36. 1
      public/system/css/chunk-1a0468a2.37478eab.css
  37. 1
      public/system/css/chunk-1a68ecae.78235be8.css
  38. 1
      public/system/css/chunk-1f07b286.e457d509.css
  39. 1
      public/system/css/chunk-21cfb337.8bf25e5c.css
  40. 1
      public/system/css/chunk-21fbd0d0.7755404f.css
  41. 1
      public/system/css/chunk-2544e1df.2b69205d.css
  42. 1
      public/system/css/chunk-2759f315.5ed16942.css
  43. 1
      public/system/css/chunk-27bd4b33.e3b28d4a.css
  44. 1
      public/system/css/chunk-2933dc34.ef676df2.css
  45. 1
      public/system/css/chunk-29a54a84.ec9d5c68.css
  46. 1
      public/system/css/chunk-2b11d4e3.37119e50.css
  47. 1
      public/system/css/chunk-2dfc014e.4a9f622d.css
  48. 1
      public/system/css/chunk-2e7b9e50.9780cf91.css
  49. 1
      public/system/css/chunk-2edc1ff1.8444a413.css
  50. 1
      public/system/css/chunk-2fe8856a.d8be8a46.css
  51. 1
      public/system/css/chunk-30881847.7db45954.css
  52. 1
      public/system/css/chunk-343630f6.2dd61b56.css
  53. 1
      public/system/css/chunk-34fd2937.05ef66e5.css
  54. 1
      public/system/css/chunk-35fd7e40.17914ded.css
  55. 1
      public/system/css/chunk-3677de9b.0703c004.css
  56. 1
      public/system/css/chunk-381533a7.b6cd4390.css
  57. 1
      public/system/css/chunk-38840cd2.f1291a7b.css
  58. 1
      public/system/css/chunk-3898c1a0.f7243856.css
  59. 1
      public/system/css/chunk-39c0a99c.d7658a25.css
  60. 1
      public/system/css/chunk-3a4b6194.911ce032.css
  61. 1
      public/system/css/chunk-3d8bee18.59159281.css
  62. 1
      public/system/css/chunk-3d96c34e.865c59e4.css
  63. 1
      public/system/css/chunk-3eb1dab1.d3988ec5.css
  64. 1
      public/system/css/chunk-3ef7da88.2a2883d6.css
  65. 1
      public/system/css/chunk-3fba3bd2.59042257.css
  66. 1
      public/system/css/chunk-3ffb5bc0.d8e87880.css
  67. 1
      public/system/css/chunk-40224e82.c912fd7f.css
  68. 1
      public/system/css/chunk-42bd9271.5985c456.css
  69. 1
      public/system/css/chunk-44adc9bc.1e8320b5.css
  70. 1
      public/system/css/chunk-44ef9718.b76d4696.css
  71. 1
      public/system/css/chunk-456b6f66.e82e77f7.css
  72. 1
      public/system/css/chunk-4598ccba.b70aa1e5.css
  73. 1
      public/system/css/chunk-45a087fd.2afe8624.css
  74. 1
      public/system/css/chunk-46945463.ebf42508.css
  75. 1
      public/system/css/chunk-4c2f3c32.6ddffe4f.css
  76. 1
      public/system/css/chunk-50f323ef.a4c371ae.css
  77. 1
      public/system/css/chunk-583dcd8a.777a60aa.css
  78. 1
      public/system/css/chunk-5a9804a8.0578a633.css
  79. 1
      public/system/css/chunk-5b115099.9a9e56dd.css
  80. 1
      public/system/css/chunk-5be271a6.062912db.css
  81. 1
      public/system/css/chunk-5dd9c032.ab4e196c.css
  82. 1
      public/system/css/chunk-5e1ff0dc.277f3ab1.css
  83. 1
      public/system/css/chunk-5ea696a0.bee6c318.css
  84. 1
      public/system/css/chunk-5fd81729.55b2c744.css
  85. 1
      public/system/css/chunk-60f093d9.ddc11ce8.css
  86. 1
      public/system/css/chunk-6136c85e.cf329d89.css
  87. 1
      public/system/css/chunk-614620aa.7570f8ae.css
  88. 1
      public/system/css/chunk-61485bac.1a80fee6.css
  89. 1
      public/system/css/chunk-615e6a64.f627f269.css
  90. 1
      public/system/css/chunk-6325995f.7fd06069.css
  91. 1
      public/system/css/chunk-64f0b07e.7350cb6a.css
  92. 1
      public/system/css/chunk-6593e728.8d482ffe.css
  93. 1
      public/system/css/chunk-65f151db.35c6bdd3.css
  94. 1
      public/system/css/chunk-66aeaa9c.11a21bf6.css
  95. 1
      public/system/css/chunk-6821f1da.314d409b.css
  96. 1
      public/system/css/chunk-694e0c68.35be1eaa.css
  97. 1
      public/system/css/chunk-6af2be5e.3523d7f3.css
  98. 1
      public/system/css/chunk-6af80672.325c0712.css
  99. 1
      public/system/css/chunk-6b314c09.1c58bcb4.css
  100. 1
      public/system/css/chunk-6d6abdee.cce348b9.css
  101. Some files were not shown because too many files have changed in this diff Show More

@ -0,0 +1,26 @@
<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
namespace app\common\dao\store;
use app\common\dao\BaseDao;
use app\common\model\store\Lottery;
use app\common\model\store\LotteryRecord;
class LotteryRecordDao extends BaseDao
{
protected function getModel(): string
{
return LotteryRecord::class;
}
}

@ -0,0 +1,30 @@
<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
namespace app\common\model\store;
use app\common\model\BaseModel;
class LotteryRecord extends BaseModel
{
public static function tablePk(): string
{
return 'id';
}
public static function tableName(): string
{
return 'lottery_record';
}
}

@ -0,0 +1,68 @@
<?php
// +----------------------------------------------------------------------
// | CRMEB [ CRMEB赋能开发者,助力企业发展 ]
// +----------------------------------------------------------------------
// | Copyright (c) 2016~2022 https://www.crmeb.com All rights reserved.
// +----------------------------------------------------------------------
// | Licensed CRMEB并不是自由软件,未经许可不能去掉CRMEB相关版权
// +----------------------------------------------------------------------
// | Author: CRMEB Team <admin@crmeb.com>
// +----------------------------------------------------------------------
namespace app\common\repositories\store;
use app\common\dao\store\GuaranteeDao;
use app\common\dao\store\LotteryDao;
use app\common\dao\store\LotteryRecordDao;
use app\common\repositories\BaseRepository;
use app\common\repositories\user\UserAssetsRepository;
class LotteryRecordRepository extends BaseRepository
{
/**
* @var LotteryRecordDao
*/
protected $dao;
/**
* GuaranteeRepository constructor.
* @param LotteryRecordDao $dao
*/
public function __construct(LotteryRecordDao $dao)
{
$this->dao = $dao;
}
/**
* TODO 平台列表
* @param $where
* @param $page
* @param $limit
* @author Qinii
* @day 5/17/21
*/
public function create($data)
{
if($data['type'] == 1){
app(UserAssetsRepository::class)->lottery($data['uid'], $data['count']);
}
return $this->dao->create($data);
}
/**
* TODO 获取详情
* @param $id
* @return array|\think\Model|null
* @author Qinii
* @day 5/17/21
*/
public function get($id)
{
$where = [
$this->dao->getPk() => $id,
];
$ret = $this->dao->getWhere($where);
return $ret;
}
}

@ -36,22 +36,14 @@ class LotteryRepository extends BaseRepository
* @param $where
* @param $page
* @param $limit
* @return array
* @author Qinii
* @day 5/17/21
*/
public function getList($where,$page, $limit)
public function getList($where)
{
$query = $this->dao->getSearch($where)->order('sort DESC');
$count = $query->count();
$list = $query->page($page,$limit)->select();
return compact('count','list');
}
public function select(array $where)
{
$list = $this->dao->getSearch($where)->field('guarantee_id,guarantee_name,guarantee_info,image')->order('sort DESC')->select();
return $list;
$query = $this->dao->getSearch($where);
$list = $query->select();
return $list->toArray();
}

@ -107,6 +107,21 @@ class UserAssetsRepository extends BaseRepository
}
public function lottery($uid, $count){
$logList = array();
$logList[] = array(
'uid' => $uid,
'asset_type' => UserAssetsLogRepository::ASSET_DIAMOND,
'type' => UserAssetsLogRepository::DIAMOND_LOTTERY,
'status' => UserAssetsLogRepository::STATUS_GET,
'count' => $count,
);
$assets = $this->assets($uid);
app()->make(UserAssetsLogRepository::class)->addLog($logList);
$this->dao->update($uid, array('diamond' => $assets['diamond'] + $count));
}
/**
* notes

@ -10,17 +10,19 @@
// +----------------------------------------------------------------------
namespace app\controller\admin\system;
use app\common\repositories\system\CacheRepository;
use app\common\repositories\system\config\ConfigValueRepository;
use app\common\repositories\store\LotteryRepository;
use app\validate\admin\DepositValidate;
use crmeb\basic\BaseController;
use crmeb\services\RedisCacheService;
use think\App;
use think\facade\Cache as BaseCache;
use think\db\exception\DataNotFoundException;
use think\db\exception\DbException;
use think\db\exception\ModelNotFoundException;
use think\facade\Request;
class Lottery extends BaseController
{
/**
* @var CacheRepository
* @var LotteryRepository
*/
protected $repository;
@ -28,79 +30,50 @@ class Lottery extends BaseController
* CacheRepository constructor.
* @param App $app
*/
public function __construct(App $app, CacheRepository $repository)
public function __construct(App $app, LotteryRepository $repository)
{
parent::__construct($app);
$this->repository = $repository;
}
public function getKeyLst()
{
$type = $this->request->param('type', 0);
$data = $this->repository->getAgreeList($type);
return app('json')->success($data);
}
/**
* @Author:Qinii
* @Date: 2020/9/15
* @return mixed
* @throws DataNotFoundException
* @throws DbException
* @throws ModelNotFoundException
* @author xaboy
* @day 2020-05-07
*/
public function getAgree($key)
public function lst()
{
$allow = $this->repository->getAgreeKey();
if (!in_array($key, $allow)) return app('json')->fail('数据不存在');
$data = $this->repository->getResult($key);
return app('json')->success($data);
return app('json')->success($this->repository->getList([]));
}
/**
* @Author:Qinii
* @Date: 2020/9/15
* @param $id
* @param DepositValidate $validate
* @return mixed
* @throws DbException
* @author xaboy
* @day 2020-05-07
*/
public function saveAgree($key)
public function save()
{
$allow = $this->repository->getAgreeKey();
if (!in_array($key, $allow)) return app('json')->fail('KEY不存在');
$value = $this->request->param('agree');
$this->repository->save($key, $value);
$data = Request::post();
if ($key == CacheRepository::USER_PRIVACY)
$this->repository->setUserAgreement($value);
if ($key == CacheRepository::USER_AGREE)
$this->repository->setUserRegister($value);
if(count($data) != 8){
return app('json')->fail('参数错误');
}
return app('json')->success('保存成功');
}
$total = array_sum(array_column($data, 'rate'));
if($total != 100)
return app('json')->fail('总概率不等于100');
/**
* TODO 清除缓存
* @return \think\response\Json
* @author Qinii
* @day 12/9/21
*/
public function clearCache()
{
$type = $this->request->param('type', 1);
switch ($type) {
case 2:
BaseCache::tag('get_product')->clear();
break;
case 3:
BaseCache::delete('get_api_config');
break;
default:
BaseCache::clear();
break;
foreach ($data as $item){
$this->repository->update($item['id'], array('type' => $item['type'], 'value' => $item['value'], 'rate' => $item['rate']));
}
$configValueRepository = app()->make(ConfigValueRepository::class);
$configValueRepository->syncConfig();
$configValueRepository->special();
return app('json')->success('清除缓存成功');
return app('json')->success('保存成功');
}
}

@ -14,6 +14,9 @@
namespace app\controller\api;
use app\common\repositories\store\DepositRepository;
use app\common\repositories\store\LotteryRecordRepository;
use app\common\repositories\store\LotteryRepository;
use app\common\repositories\store\order\StoreGroupOrderRepository;
use app\common\repositories\store\order\StoreOrderRepository;
use app\common\repositories\store\order\StoreRefundOrderRepository;
@ -199,6 +202,36 @@ class Auth extends BaseController
}
public function lotteryData(){
return app('json')->success(app(LotteryRepository::class)->getList([]));
}
public function lotteryTry(){
$list = app(LotteryRepository::class)->getList([]);
$rand = $try = rand(1,100);
$current = null;
foreach ($list as $item){
$try = $try - $item['rate'];
if($try <= 0){
$current = $item;
break;
}
}
app(LotteryRecordRepository::class)->create([
'uid' => 10,
'type' => $current['type'],
'lottery_id' => $current['id'],
'count' => $current['value'],
]);
return app('json')->success(array('try' => $rand, 'item' => $current));
}
public function depositData(){
$ret = app(DepositRepository::class)->getList(['status' => 1], 1, 10);
return app('json')->success($ret['list']);
}
/**
* notes 兑换配置
* @return mixed

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1 +0,0 @@
.el-dropdown-link[data-v-7a1aa09a]{cursor:pointer;color:var(--prev-color-primary);font-size:12px}.el-icon-arrow-down[data-v-7a1aa09a]{font-size:12px}

@ -1 +0,0 @@
[data-v-48774f7a]{-moz-user-select:none;-webkit-user-select:none;-ms-user-select:none;user-select:none}.title[data-v-48774f7a]{margin-bottom:-19px!important;padding-bottom:17px!important}.left[data-v-48774f7a]{min-width:390px;min-height:550px;position:relative;padding-left:40px}.top[data-v-48774f7a]{position:absolute;top:0}.bottom[data-v-48774f7a],.textbot[data-v-48774f7a]{position:absolute;bottom:0}.textbot[data-v-48774f7a]{left:59px;width:100%}.active[data-v-48774f7a]{border:1px solid #44b549!important;color:#44b549!important}.li[data-v-48774f7a]{float:left;width:93px;line-height:48px;border:1px solid #e7e7eb;background:#fafafa;text-align:center;cursor:pointer;color:#999;position:relative}.text[data-v-48774f7a]{height:50px;overflow:hidden;text-overflow:ellipsis;-ms-text-overflow:ellipsis;white-space:nowrap;padding:0 5px}.text[data-v-48774f7a]:hover{color:#000}.add[data-v-48774f7a]{position:absolute;bottom:65px;width:100%;line-height:48px;border:1px solid #e7e7eb;background:#fafafa}.arrow[data-v-48774f7a]{position:absolute;bottom:-16px;left:36px;width:0;height:0;font-size:0;border:8px solid;border-color:#fff #f4f5f9 #f4f5f9 #f4f5f9}.tianjia[data-v-48774f7a]{position:absolute;bottom:115px;width:100%;line-height:48px;background:#fafafa}.addadd[data-v-48774f7a]{width:100%;line-height:48px;border:1px solid #e7e7eb;background:#fafafa;height:48px}.right[data-v-48774f7a]{background:#fff;min-height:400px}.spwidth[data-v-48774f7a]{width:100%}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -1 +0,0 @@
.card_container[data-v-8d6f14c6]{margin-top:150px;text-align:center}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save