Task.php 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <?php
  2. namespace app\controller\api\shareProsperity;
  3. use app\common\enum\CommonEnum;
  4. use app\common\repositories\shared\SharedProsperityTaskRepository;
  5. use think\facade\Db;
  6. class Task
  7. {
  8. // 合伙人分红
  9. public function partnerProfits()
  10. {
  11. $get = app()->request->get();
  12. /** @var SharedProsperityTaskRepository $repository */
  13. $repository = app()->make(SharedProsperityTaskRepository::class);
  14. $data = $repository->partner($get);
  15. return app('json')->success($data);
  16. }
  17. public function thankProfits()
  18. {
  19. $get = app()->request->get();
  20. /** @var SharedProsperityTaskRepository $repository */
  21. $repository = app()->make(SharedProsperityTaskRepository::class);
  22. $repository->thank($get);
  23. return app('json')->success();
  24. }
  25. public function groupProfits()
  26. {
  27. $get = app()->request->get();
  28. /** @var SharedProsperityTaskRepository $repository */
  29. $repository = app()->make(SharedProsperityTaskRepository::class);
  30. $data = $repository->group($get);
  31. return app('json')->success($data);
  32. }
  33. public function testProfits()
  34. {
  35. // 李玉枝 国宝中 秒简化 李守之 赵娜
  36. // 直推
  37. // $userData = [
  38. // 2393=>82.80,
  39. // 4324=>110.4,
  40. // 4073=>82.8,
  41. // 2540=>55.2,
  42. // 2950=>55.2
  43. //
  44. // ];
  45. // 总裁分红
  46. // $userData = [
  47. // // 李玉枝
  48. // 2393=>18,
  49. // // 国宝中
  50. // 4324=>15,
  51. // // 秒简化
  52. // 4073=>13,
  53. // // 李守之
  54. // 2540=>9,
  55. // // 赵娜
  56. // 2950=>9,
  57. // // xuliping
  58. // 43=>289,
  59. // // lisuhong
  60. // 62=>364,
  61. // // liuyinxia
  62. // 192=>408,
  63. // // 钟起群
  64. // 4758=>6,
  65. // // 王运香
  66. // 4033=>6,
  67. // // 李建生
  68. // 4348=>6,
  69. // // 张贵兰
  70. // 4245=>6,
  71. // // 黄远学
  72. // 4897=>6,
  73. // // 迟徳瑞
  74. // 4896=>6,
  75. // // 陶艺雯
  76. // 3160=>6,
  77. // // 王凤菲
  78. // 4898=>6,
  79. // // 张娜
  80. // 4899=>6,
  81. // // 刘洪军
  82. // 4656=>6,
  83. // // 金刚
  84. // 2846=>6,
  85. // // 刘亚娟没有手机号
  86. // ];
  87. // 万人团
  88. $userData = [
  89. // 国宝中
  90. 4324 => 6,
  91. // 秒简化
  92. 4073 => 6,
  93. // 李守之
  94. 2540 => 6,
  95. // 钟起群
  96. 4758 => 6,
  97. // 王运香
  98. 4033 => 6,
  99. // 李建生
  100. 4348 => 6,
  101. // 张贵兰
  102. 4245 => 6,
  103. // 黄远学
  104. 4897 => 6,
  105. // 迟徳瑞
  106. 4896 => 6,
  107. // 陶艺雯
  108. 3160 => 6,
  109. // 王凤菲
  110. 4898 => 6,
  111. // 张娜
  112. 4899 => 6,
  113. // 刘洪军
  114. 4656 => 6,
  115. // 金刚
  116. 2846 => 6,
  117. // 刘亚娟没有手机号
  118. // xuliping
  119. 43 => 66,
  120. // lisuhong
  121. 62 => 66,
  122. // liuyinxia
  123. 192 => 66,
  124. ];
  125. foreach ($userData as $uid => $money) {
  126. $bill = [
  127. 'uid' => $uid,
  128. 'link_id' => 0,
  129. 'pm' => 1,
  130. 'title' => '共富万人团分红',
  131. 'category' => 'now_money',
  132. 'type' => 'commission',
  133. 'number' => $money,
  134. 'balance' => 0,
  135. 'mark' => '共富万人团分红',
  136. 'create_time' => date('Y-m-d H:i:s'),
  137. 'status' => 1,
  138. 'commission_type' => CommonEnum::COMMISSION_TYPE['SHARED_PROSPERITY_GROUP_COMMISSION']['code'],
  139. 'order_sn' => 0,
  140. 'tripartite' => 0,
  141. 'type_shop' => 0,
  142. 'mer_id' => 0,
  143. 'source' => 0,
  144. 'order_type' => 1,
  145. 'is_red_brokerage' => 0,
  146. 'gzc' => 3,
  147. 'take_time' => time(),
  148. 'district_id' => '',
  149. 'street_id' => '',
  150. 'month' => '',
  151. ];
  152. $a = Db::name('user_bill')->insert($bill);
  153. $b = Db::name('user')->where('uid',$uid)->inc('brokerage_price',$money)->update();
  154. }
  155. }
  156. }