<?php
namespace app\controller\api\warehouse;
use crmeb\basic\BaseController;
use think\facade\Db;

class Channel extends BaseController
{
    //检查是否是渠道商
    public function check()
    {
        $uid=$this->request->uid();

        $data=Db::name('channel_user')->where('uid',$uid)->where('status',1)->find();
        if($data){
            return app('json')->success('1');
        }else{
            return app('json')->success('0');
        }
    }
    //渠道商激活码
    public function channel_code()
    {
        [$page, $limit] = $this->getPage();
        $uid=$this->request->uid();
        $data=Db::name('activation_code')->where('uid',$uid)->page($page,$limit)->where('type',2)->field('code,status')->select()->toArray();
        return app('json')->success($data);
    }
}