Inviterclass.php 780 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace app\common\model;
  3. use think\facade\Db;
  4. /**
  5. *
  6. *
  7. * ----------------------------------------------------------------------------
  8. *
  9. * 数据层模型
  10. */
  11. class Inviterclass extends BaseModel
  12. {
  13. //获取分销员所对应的等级
  14. public function getInviterclass($inviterclass_amount)
  15. {
  16. $inviterclass_name = '';
  17. $inviterclass_list = Db::name('inviterclass')->order('inviterclass_amount asc')->select()->toArray();
  18. foreach ($inviterclass_list as $inviterclass) {
  19. if ($inviterclass_amount >= $inviterclass['inviterclass_amount']) {
  20. $inviterclass_name = $inviterclass['inviterclass_name'];
  21. }
  22. }
  23. return $inviterclass_name;
  24. }
  25. }