Channel.php 808 B

12345678910111213141516171819202122232425262728
  1. <?php
  2. namespace app\controller\api\warehouse;
  3. use crmeb\basic\BaseController;
  4. use think\facade\Db;
  5. class Channel extends BaseController
  6. {
  7. //检查是否是渠道商
  8. public function check()
  9. {
  10. $uid=$this->request->uid();
  11. $data=Db::name('channel_user')->where('uid',$uid)->where('status',1)->find();
  12. if($data){
  13. return app('json')->success('1');
  14. }else{
  15. return app('json')->success('0');
  16. }
  17. }
  18. //渠道商激活码
  19. public function channel_code()
  20. {
  21. [$page, $limit] = $this->getPage();
  22. $uid=$this->request->uid();
  23. $data=Db::name('activation_code')->where('uid',$uid)->page($page,$limit)->where('type',2)->field('code,status')->select()->toArray();
  24. return app('json')->success($data);
  25. }
  26. }