Index.php 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  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. $this->success(1,$list);
  23. }
  24. //商家钱包明细
  25. public function money_log(){
  26. $type = input('type',0);
  27. $map = [
  28. 'user_id' => $this->auth->id,
  29. ];
  30. if($type){
  31. $map['log_type'] = $type;
  32. }
  33. $list = Db::name('company_money_log')
  34. ->field('id,log_type,change_value,remain,remark,createtime')
  35. ->where($map)->order('id desc')->autopage()->select();
  36. $list = $this->list_appen_logtext($list);
  37. $this->success(1,$list);
  38. }
  39. //追加log_text
  40. private function list_appen_logtext($list){
  41. if(!empty($list)){
  42. $conf = config('wallet.logtype');
  43. foreach($list as $key => $val){
  44. $list[$key]['log_text'] = isset($conf[$val['log_type']]) ? $conf[$val['log_type']] : '';
  45. }
  46. }
  47. return $list;
  48. }
  49. }