Index.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. namespace app\api\controller\company;
  3. use app\common\controller\Apic;
  4. use think\Db;
  5. /**
  6. * 会员接口
  7. */
  8. class Index extends Apic
  9. {
  10. protected $noNeedLogin = [];
  11. protected $noNeedRight = '*';
  12. //首页
  13. public function index(){
  14. }
  15. //首页轮播
  16. public function banner(){
  17. $where = [
  18. 'status' => 1,
  19. 'position' => 1
  20. ];
  21. $list = Db::name('platform_banner')->where($where)->order('weigh asc,id asc')->select();
  22. $list = list_domain_image($list,['image']);
  23. $this->success(1,$list);
  24. }
  25. //商家钱包明细
  26. public function money_log(){
  27. $type = input('type',0);
  28. $map = [
  29. 'user_id' => $this->auth->id,
  30. ];
  31. if($type){
  32. $map['log_type'] = $type;
  33. }
  34. $list = Db::name('company_money_log')
  35. ->field('id,log_type,change_value,remain,remark,createtime')
  36. ->where($map)->order('id desc')->autopage()->select();
  37. $list = $this->list_appen_logtext($list);
  38. $this->success(1,$list);
  39. }
  40. //追加log_text
  41. private function list_appen_logtext($list){
  42. if(!empty($list)){
  43. $conf = config('wallet.logtype');
  44. foreach($list as $key => $val){
  45. $list[$key]['log_text'] = isset($conf[$val['log_type']]) ? $conf[$val['log_type']] : '';
  46. }
  47. }
  48. return $list;
  49. }
  50. }