private function _getCurrentCustomerCurrentAchievement() { /* 取用户基本信息**** */ $openid = (string) $this->postObj->FromUserName; //获取当前周期的开始结束日期 $config = new ConfigModel(); $times = $config->getBeginTimeAndEndTime(); $beginTime = $times['endTime']; $endTime = time(); //取当期业绩信息中直销业绩 $relationForm = new OrderRelationModel(); $currentAchievement['direct'] = $relationForm->getAchievementByOpenid($openid, $beginTime, $endTime); //取出上线为自已的所有用户的业绩 $customer = new CustomerModel(); $openids = $customer->getLineOpenids($openid); $currentAchievement['line'] = $relationForm->getAchievementByOpenid($openids, $beginTime, $endTime); //添加直销,线销系数 $rebate = new RebateModel(); //取直销系数 $dataArr[0] = $currentAchievement['direct']; $key = '_totalGoodsFee'; $keyReturn = '_direct_radio'; $dataArr = $rebate->getRatioByMoney($dataArr, $key, $keyReturn); $currentAchievement['_direct_radio'] = $dataArr[0][$keyReturn]; //取线销系数 $dataArr[0] = $currentAchievement['line']; $keyReturn = '_line_radio'; $dataArr = $rebate->getRatioByMoney($dataArr, $key, $keyReturn); $currentAchievement['_line_radio'] = $dataArr[0][$keyReturn]; return $currentAchievement; }
public function indexAction() { /* 取用户基本信息**** */ $customerInfo = $this->customerInfo; //设置用户状态,用以显示“修改个人信息还是请完善个人信息” if (trim($customerInfo['phone_number']) == '' || trim($customerInfo['account']) == '') { $customerInfo['flag'] = 1; } else { $customerInfo['flag'] = 0; } $this->assign('customer', $customerInfo); $openid = get_openid(); //取订单数量 $orderForm = new OrderFormModel(); $noPayOrderCount = $orderForm->getNopayOrderCountByOpenid($openid); $payedOrderCount = $orderForm->getPayedOrderCountByOpenid($openid); //传订单数量数据 $this->assign('noPayOrderCount', $noPayOrderCount); $this->assign('payedOrderCount', $payedOrderCount); //获取当前周期的开始结束日期 $config = new ConfigModel(); $times = $config->getBeginTimeAndEndTime(); $beginTime = $times['endTime']; $endTime = time(); //取当期业绩信息中直销业绩 $relationForm = new OrderRelationModel(); $currentAchievement['direct'] = $relationForm->getAchievementByOpenid($openid, $beginTime, $endTime); //取出上线为自已的所有用户的业绩 $customer = new CustomerModel(); $openids = $customer->getLineOpenids($openid); $currentAchievement['line'] = $relationForm->getAchievementByOpenid($openids, $beginTime, $endTime); //添加直销,线销系数 $rebate = new RebateModel(); //取直销系数 $dataArr[0] = $currentAchievement['direct']; $key = '_totalGoodsFee'; $keyReturn = '_direct_radio'; $dataArr = $rebate->getRatioByMoney($dataArr, $key, $keyReturn); $currentAchievement['_direct_radio'] = $dataArr[0][$keyReturn]; //取线销系数 $dataArr[0] = $currentAchievement['line']; $keyReturn = '_line_radio'; $dataArr = $rebate->getRatioByMoney($dataArr, $key, $keyReturn); $currentAchievement['_line_radio'] = $dataArr[0][$keyReturn]; $this->assign('achievement', $currentAchievement); $changeUrl = U('ChangePhone/index'); $this->assign('changeUrl', $changeUrl); $account = U('Account/index'); $couponUrl = U('User/Coupon/index'); $this->assign('couponUrl', $couponUrl); $this->assign('wangqiurl', U('User/Achievement/pastData')); $finishedOrderUrl = U('UserCenter/OrderManage/finishedOrder'); $payedOrderUrl = U('UserCenter/OrderManage/payedOrder'); $unpayOrderUrl = U('UserCenter/OrderManage/unpayedOrder'); $allOrderUrl = U('UserCenter/OrderManage/allOrder'); $this->assign('finishedOrderUrl', $finishedOrderUrl); $this->assign('payedOrderUrl', $payedOrderUrl); $this->assign('unpayOrderUrl', $unpayOrderUrl); $this->assign('allOrderUrl', $allOrderUrl); $this->assign('count', $count); $css = $this->fetch('indexCss'); $this->assign('indexCss', $css); $this->assign("YZBody", $this->fetch()); $this->display(YZ_TEMPLATE); }