示例#1
0
 public function index()
 {
     if (empty($_COOKIE['aid'])) {
         $this->display('login');
     } else {
         $sqlGood = new sql_goodMod();
         $sqlSend = new sql_sendMod();
         $this->assign('user', $_COOKIE['name']);
         // 获取学校信息
         $school_info = $this->model->table($this->config['school'])->field($field)->where($con)->select();
         $this->assign('s_info', $school_info);
         if ($_COOKIE['power'] == 0) {
             $brand_info = $sqlGood->get_brand_manager(0);
             $this->assign('b_info', $brand_info);
             // 展示经销商
             $admin_info = $sqlGood->get_admin_manager();
             $this->assign('a_info', $admin_info);
             $this->display('index-super');
         } else {
             if ($_COOKIE['power'] == 1) {
                 // $a_id = 2;   ################## 这个是管理员 id,必须严格控制
                 $a_id = $this->in_cookie('aid', None, 1, 'True');
                 $good_info = $sqlGood->get_brand($a_id);
                 $this->assign('g_info', $good_info);
                 // 获取配送员信息
                 $sender_info = $sqlSend->get_sender($a_id);
                 $this->assign('sd_info', $sender_info);
                 $this->display('index');
             }
         }
     }
 }
示例#2
0
 public function get_school_brand()
 {
     $sqlGood = new sql_goodMod();
     $s_id = $this->in_get('id', None, 1, 'True');
     $c_id = $this->in_get('cid', None, 1, 'True');
     $res = $sqlGood->get_brand_manager($s_id, $c_id);
     echo json_encode($res);
 }