<?php
namespace App\Controller;
use Common\Controller\HanchaoController;
class DeccaController extends BaseController {
	public function _initialize(){
		parent::_initialize ();
    }
    public function index(){
        $return=array('status'=>1,'msg'=>'');
        $paramdata = I('param.');
        $shop_id=intval($paramdata['shop_id']);
        $shopewm=deccacode($shop_id);
        if($shopewm['status']==1 && $shopewm['url']){
            $data['decca_img']=$shopewm['url'];
        }
        if($data['decca_img']){
            $return['data']=$data;
        }else{
            $return['status']=2;
            $return['msg']='未获取到数据';
        }
        $this->ajaxReturn($return);
    }
    public function add_receipt(){
        $return=array('status'=>3,'msg'=>'');
        $postdata = I('param.');
        if($postdata['is_root'] != 1){
            $return['msg']='您没有操作权限';
            $this->ajaxReturn($return);
        }
        $return = D('Shops')->add_receipt($postdata);
        $this->ajaxReturn($return);
    }
    public function get_info(){
        $return=array('status'=>3,'msg'=>'');
        $postdata = I('param.');
        if($postdata['is_root'] != 1){
            $return['msg']='您没有操作权限';
            $this->ajaxReturn($return);
        }
        $where=array();
        $where['id']=intval($postdata['root_id']);
        $return['data']=M('Admin')->where($where)->field('alipay_img,weixin_img,other_img')->find();
        if($return['data']){
            $return['status']=1;
        }else{
            $return['msg']="无该账号信息";
        }
        $this->ajaxReturn($return);
    }
}
?>