Ejemplo n.º 1
0
 public function valInsert()
 {
     $model = new AttrValModel();
     $data = I('post.');
     if (false === $model->myAdd($data)) {
         $this->error($model->getError());
     }
     $this->success('新建成功', U(CONTROLLER_NAME . '/valLists', array('atid' => $data['attr_id'])));
 }
Ejemplo n.º 2
0
 /**
  * 店铺属性查看页面
  * @param int $id	店铺ID
  */
 public function attrRead($id)
 {
     $map['store_id'] = (int) $id;
     if ($map['store_id'] <= 0) {
         $this->error('请选择店铺');
     }
     $this->assign('store_id', $id);
     $AttrVal_M = new AttrValModel();
     $attr_hash = $AttrVal_M->hashList();
     $this->assign('attr_hash', $attr_hash);
     //属性-属性值 的hash数组
     $StoreAttr_M = new StoreAttrModel();
     $store_attrs = $StoreAttr_M->where($map)->getField('attr_val_id', true);
     $this->assign('store_attrs', $store_attrs);
     //该店铺所有的属性值数组
     cookie(C('CURRENT_URL_NAME'), $_SERVER['REQUEST_URI']);
     $this->display();
 }