Beispiel #1
0
 /**
  * 获得数据列表
  */
 public function doDefault(ZOL_Request $input, ZOL_Response $output)
 {
     //获得所有会员类型
     $output->memberCate = Helper_Member::getMemberCatePairs();
     //获得所有的员工
     $output->staffArr = Helper_Staff::getStaffPairs();
     //获得所有配置
     $output->sysOptions = Helper_Option::getAllOptions();
     $output->scoreRatio = !empty($output->sysOptions["ScoreRatio"]) ? $output->sysOptions["ScoreRatio"]["value"] : 0;
     //获得商品的所有分类
     $output->productCateArr = Helper_Product::getProductCatePairs();
     $output->productCateJson = api_json_encode($output->productCateArr);
     $output->setTemplate('Checkout');
 }
Beispiel #2
0
 /**
  * 获得数据列表
  */
 public function doDefault(ZOL_Request $input, ZOL_Response $output)
 {
     $output->ctype = (int) $input->get("ctype");
     //其他产品的消费类型
     if (!$output->ctype) {
         $output->ctype = 2;
     }
     //获得所有会员类型
     $output->memberCate = Helper_Member::getMemberCatePairs();
     //获得所有的员工
     $output->staffArr = Helper_Staff::getStaffPairs();
     $output->proCtypeArr = ZOL_Config::get("GLOBAL", "PRO_CTYPE");
     if (!isset($output->proCtypeArr[$output->ctype])) {
         echo "ERROR";
         exit;
     }
     $output->ctypeName = $output->proCtypeArr[$output->ctype]['name'];
     $output->setTemplate('CheckoutOtherPro');
 }
Beispiel #3
0
 /**
  *  添加会员并充值
  */
 public function doAddUserAndCard(ZOL_Request $input, ZOL_Response $output)
 {
     $output->andCard = (int) $input->get("andCard");
     //是否添加账号并进行充值
     $Arr = array();
     $Arr['name'] = $input->post('name');
     $Arr['phone'] = $input->post('phone');
     $Arr['cardno'] = $input->post('cardno');
     $Arr['cateId'] = $input->post('cateId');
     $Arr['byear'] = $input->post('byear');
     $Arr['bmonth'] = $input->post('bmonth');
     $Arr['bday'] = $input->post('bday');
     $Arr['addTm'] = SYSTEM_TIME;
     $Arr['score'] = 0;
     $balance = $Arr['balance'] = $input->post('balance');
     $Arr['remark'] = $input->post('remark');
     $remark2 = $input->post('remark2');
     $Arr['introducer'] = $input->post('introducer');
     $staffid = (int) $input->post("staffid");
     if (!$balance) {
         echo "<script>alert('请填写充值卡金额');document.location='?c=Member&a=ToAddUserFromBill&andCard=1';</script>";
         exit;
     }
     //查看该电话是否注册了
     $minfo = Helper_Member::getMemberInfo(array('phone' => $Arr['phone']));
     if ($minfo) {
         echo "<script>alert('该会员已经存在了,不能再次添加,直接充值就可以了');document.location='?c=Member&phone={$Arr['phone']}';</script>";
         exit;
     }
     $minfo = $Arr;
     //确认一下介绍人
     if ($Arr['introducer']) {
         //如果是新添加用户,验证介绍人是否存在
         $pminfo = Helper_Member::getMemberInfo(array('phone' => $Arr['introducer']));
         if (!$pminfo) {
             #如果没有查到这个会员,清空介绍人字段
             $Arr['introducer'] = false;
         }
     }
     //添加会员
     $memberId = Helper_Dao::insertItem(array('addItem' => $Arr, 'dbName' => 'Db_Andyou', 'tblName' => 'member'));
     $card = $balance;
     //进行充值
     //        $db = Db_Andyou::instance();
     //        $sql = "update member set balance = balance + {$Arr['balance']} where id = {$memberId}";
     //        $db->query($sql);
     //        $output->bno         = Helper_Bill::getCardMaxBno();
     $output->bno = Helper_Bill::getCommonMaxBno();
     $logItem = array("memberId" => $memberId, "direction" => 0, "card" => $Arr['balance'], "dateTm" => SYSTEM_TIME, "adminer" => $output->admin, "remark" => $remark2, "orgCard" => 0, "staffid" => $staffid, "bno" => $output->bno);
     $data = Helper_Dao::insertItem(array('addItem' => $logItem, 'dbName' => 'Db_Andyou', 'tblName' => 'log_cardchange'));
     $memCate = Helper_Member::getMemberCatePairs();
     //会员类型
     $minfo["cateName"] = $memCate[$minfo["cateId"]];
     $output->money = $card;
     #充值的钱
     $output->nowBalance = $card;
     $output->memberInfo = $minfo;
     $staffArr = Helper_Staff::getStaffPairs();
     $output->staffName = $staffArr[$staffid];
     Helper_Bill::createOneCommonBno();
     //生成一个通用订单号
     $output->setTemplate("CardPrint");
 }