Example #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');
             }
         }
     }
 }
Example #2
0
 public function saveBasic()
 {
     $sqlSend = new sql_sendMod();
     $a_id = $this->in_cookie('aid', None, 1, 'True');
     $send_id = $this->in_get('id', None, 1, 'True');
     $s_id = $this->in_get('sid', None, 1, 'True');
     $c_id = $this->in_get('cid', None, 1, 'True');
     $addrs = $this->in_get('addrs', None, 2, 'True');
     $update_res = $sqlSend->set_send_info($a_id, $send_id, $s_id, $c_id, $addrs);
     if ($update_res) {
         echo '更新成功';
     } else {
         echo '更新失败';
     }
 }