BoxLogic.php 807 B

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace app\admin\logic;
  3. use app\admin\model\dao\MoneyLog;
  4. use app\admin\model\dao\ScoreLog;
  5. use app\admin\model\dao\ShopOrder;
  6. use app\admin\model\dao\User;
  7. use app\common\model\BoxModel;
  8. use app\common\model\UserMoneyModel;
  9. use think\facade\Cache;
  10. use think\facade\Db;
  11. class BoxLogic
  12. {
  13. public static function getList($page, $limit, $where, $sort)
  14. {
  15. $count = (new BoxModel())
  16. ->where($where)
  17. ->count();
  18. $list = (new BoxModel())
  19. ->withoutField('password')
  20. ->withAttr('box_img', function ($val, $data) {
  21. return getWebUrl() . '/' . $val;
  22. })
  23. ->where($where)
  24. ->page($page, $limit)
  25. ->order($sort)
  26. ->select();
  27. return [$count, $list];
  28. }
  29. }