protected function ajaxExecute(MUser $me, MShop $shop)
 {
     $num_iid = MRequest::post('iid');
     //  商品id
     $cid = MRequest::post('cid');
     //  分类id
     $title = MRequest::post('title');
     $imgmd5 = MRequest::post('imgmd5');
     $imgtype = MRequest::post('imgtype');
     $price = MRequest::post('price');
     $stock = null;
     // $stock = MRequest::post('stock');
     $onsale = MRequest::post('onsale');
     $listtime = MRequest::post('listtime');
     $delisttime = MRequest::post('delisttime');
     $listtime = strtotime($listtime);
     $delisttime = strtotime($delisttime);
     DalItem::beginTransaction();
     try {
         DalItem::updateShopItem($num_iid, $shop->getID(), $cid, $title, $imgmd5, $imgtype, $price, $stock, $onsale, $listtime, $delisttime);
         $item = DalItem::getShopItem($shop->getID(), $num_iid, 'w');
         if (!$item) {
             throw new Exception("item not exists", -100);
         }
     } catch (Exception $e) {
         DalItem::rollback();
         return MJsonRespond::respondFail($e->getMessage());
     }
     DalItem::commit();
     return MJsonRespond::respondSuccess('成功', array('item' => $item));
 }
 public function pageExecute()
 {
     $shopname = MRequest::post('shopname');
     $username = MRequest::post('username');
     $password = MRequest::post('password');
     $email = MRequest::post('email');
     $this->assign('shopname', $shopname);
     $this->assign('email', $email);
     $this->page = 'sign/validemail.tpl.php';
 }
 public function execute()
 {
     $username = MRequest::post('username');
     $password = MRequest::post('password');
     $md5password = md5($password);
     $me = MUser::signin($username, $md5password);
     if (!$me) {
         redirect('/signin');
         return;
     }
     redirect('/');
 }
 public function execute()
 {
     $shopname = MRequest::post('shopname');
     $username = MRequest::post('username');
     $password = MRequest::post('password');
     $email = MRequest::post('email');
     $md5Password = md5($password);
     $uid = LibPCUser::signup($username, $password, $email);
     LibPCUser::setUserVerification($uid);
     DalShop::addOrUpdateShop($shopname, $uid, '', '', '', '', '', 1, 0);
     // redirect('/valid-email');
     redirect('/dashboard/shop/geo');
 }
 protected function ajaxExecute(MUser $me, MShop $shop)
 {
     $lng = MRequest::post('lng');
     $lat = MRequest::post('lat');
     $address = MRequest::post('address');
     $radius = MRequest::post('radius');
     $servetime = MRequest::post('servetime');
     try {
         DalShop::addOrUpdateShopGeo($shop->getID(), $lng, $lat, $address, $radius, $servetime);
     } catch (Exception $e) {
         return MJsonRespond::respondFail($e->getMessage());
     }
     return MJsonRespond::respondSuccess('成功');
 }
 protected function ajaxExecute(MUser $me, MShop $shop)
 {
     $shopname = MRequest::post('shopname');
     $intro = MRequest::post('intro');
     $imgmd5 = MRequest::post('imgmd5');
     $imgtype = MRequest::post('imgtype');
     $tel = MRequest::post('tel');
     $bulletin = '';
     $qq = '';
     $email = '';
     try {
         DalShop::updateShop($shop->getID(), $shopname, $intro, $bulletin, $qq, $tel, $email, $imgmd5, $imgtype);
     } catch (Exception $e) {
         return MJsonRespond::respondFail($e->getMessage());
     }
     return MJsonRespond::respondSuccess('成功');
 }
 protected function ajaxExecute(MUser $me, MShop $shop)
 {
     $cid = MRequest::post('cid');
     $ps = (int) MRequest::post('ps');
     $pn = (int) MRequest::post('pn');
     $ps = max(0, $ps);
     if (!$pn) {
         $pn = 20;
     }
     try {
         $itemlist = $shop->getShopItems($cid, $ps, $pn);
         $foundrows = $shop->totalCount();
     } catch (Exception $e) {
         return MJsonRespond::respondFail('获取商品列表失败');
     }
     return MJsonRespond::respondSuccess('成功', array('itemlist' => $itemlist, 'total' => $foundrows));
 }
 public function pageExecute()
 {
     $shopname = MRequest::post('shopname');
     $this->assign('shopname', $shopname);
     $this->page = 'sign/signup.tpl.php';
 }
Exemple #9
0
 public function post($key, $default = null)
 {
     return $this->request->post($key, $default);
 }