示例#1
0
 /**
  * 小店通
  */
 public function showAction()
 {
     //http://amazeui.org/
     $type = $this->param('t', '');
     if (!$type) {
         exit('小店通主页不存在');
     }
     switch ($type) {
         case '1':
             $sid = intval($this->param('s', 0));
             $store = ShopData::getStore($sid);
             if (!$store) {
                 exit('小店通主页不存在');
             }
             //print_r($store);
             $cates = ShopData::getStoreCates($store['id']);
             if ($cates) {
                 foreach ($cates as $cate) {
                     $tmp[$cate['id']] = $cate;
                 }
                 $cates = $tmp;
             }
             $goods = ShopData::getStoreGoods($store['id']);
             if ($goods) {
                 foreach ($goods as $good) {
                     $cates[$good['store_cate_id']]['goods'][] = $good;
                 }
             }
             $qr = $this->qrCode($store, 's');
             $this->assign('qr', $qr);
             $this->assign('cates', $cates);
             $this->assign('info', $store);
             $tpl = 'Page/store.html';
             break;
         case '2':
             break;
         default:
             break;
     }
     $this->display();
 }
示例#2
0
 /**
  * 商品管理
  */
 public function goodsAction()
 {
     $currUser = $this->getCurrentUser();
     $editId = intval($this->param('edit', 0));
     if ($editId) {
         $good = ShopData::getStoreGood($editId);
         $this->assign('good', $good);
         $tpl = "Shop/edit_good.html";
     } else {
         $goods = ShopData::getStoreGoods($currUser['id']);
         $this->assign('goods', $goods);
         $tpl = "Shop/goods.html";
     }
     $cates = ShopData::getStoreCates($currUser['id']);
     $this->assign('cates', $cates);
     $this->display($tpl);
 }