Index.php 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. $map = [
  28. 'user_id' => $this->auth->company_id,
  29. ];
  30. $list = Db::name('company_money_log')
  31. ->field('id,log_type,change_value,remain,remark,createtime')
  32. ->where($map)->order('id desc')->autopage()->select();
  33. //$list = $this->list_appen_logtext($list);
  34. $this->success(1,$list);
  35. }
  36. //追加log_text
  37. private function list_appen_logtext($list){
  38. if(!empty($list)){
  39. $conf = config('wallet.logtype');
  40. foreach($list as $key => $val){
  41. $list[$key]['log_text'] = isset($conf[$val['log_type']]) ? $conf[$val['log_type']] : '';
  42. }
  43. }
  44. return $list;
  45. }
  46. }