1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374 |
- <?php
- namespace app\api\controller\company;
- use app\common\controller\Apic;
- use think\Db;
- /**
- * 会员接口
- */
- class Index extends Apic
- {
- protected $noNeedLogin = [];
- protected $noNeedRight = '*';
- //首页
- public function index(){
- }
- //首页轮播
- public function banner(){
- $where = [
- 'status' => 1,
- 'position' => 1
- ];
- $list = Db::name('platform_banner')->where($where)->order('weigh asc,id asc')->select();
- $list = list_domain_image($list,['image']);
- $this->success(1,$list);
- }
- //商家钱包明细
- public function money_log(){
- $map = [
- 'user_id' => $this->auth->company_id,
- ];
- $list = Db::name('company_money_log')
- ->field('id,log_type,change_value,remain,remark,createtime')
- ->where($map)->order('id desc')->autopage()->select();
- //$list = $this->list_appen_logtext($list);
- $this->success(1,$list);
- }
- //追加log_text
- private function list_appen_logtext($list){
- if(!empty($list)){
- $conf = config('wallet.logtype');
- foreach($list as $key => $val){
- $list[$key]['log_text'] = isset($conf[$val['log_type']]) ? $conf[$val['log_type']] : '';
- }
- }
- return $list;
- }
- //资金账单,用来显示本门店下所有用户的储值卡的流水日志
- public function usermoney_info(){
- $usernumber = Db::name('user_wallet')->where('company_id',$this->auth->company_id)->count();
- $summoney = Db::name('user_wallet')->where('company_id',$this->auth->company_id)->sum('money');
- $rs = [
- 'usernumber' => $usernumber,
- 'summoney' => $summoney,
- ];
- return $this->success(1,$rs);
- }
- }
|