Beispiel #1
0
 /**
  * 统计抓取数据
  */
 public function statcrawlAction()
 {
     $iLast1Day = strtotime('-1day');
     $iWeixinCreateCnt = Model_Media::query('SELECT COUNT(*) FROM t_crawl_weixin WHERE iCreateTime>=' . $iLast1Day, 'one');
     $iWeixinUpdateCnt = Model_Media::query('SELECT COUNT(*) FROM t_crawl_weixin WHERE iUpdateTime>=' . $iLast1Day, 'one');
     $iArticeCreateCnt = Model_Media::query('SELECT COUNT(*) FROM t_crawl_weixin_article WHERE iCreateTime>=' . $iLast1Day, 'one');
     $iArticeUpdateCnt = Model_Media::query('SELECT COUNT(*) FROM t_crawl_weixin_article WHERE iUpdateTime>=' . $iLast1Day, 'one');
     $sBody = "\n    今天数据抓取结果如下:<br>\n\n    微信公众号新增:{$iWeixinCreateCnt}个<br>\n\n    微信公众号更新:{$iWeixinUpdateCnt}个<br>\n\n    微信文章新增:{$iArticeCreateCnt}个<br>\n\n        ";
     echo $sBody;
     $aTo = array('*****@*****.**', '*****@*****.**', '*****@*****.**', '*****@*****.**', '*****@*****.**', '*****@*****.**');
     Util_Mail::send('*****@*****.**', '51wom数据抓取结果(' . date('Y-m-d') . ')', $sBody);
 }
Beispiel #2
0
 /**
  * 用户修改
  */
 public function editAction()
 {
     if ($this->_request->isPost()) {
         $aUser = $this->_checkData('update');
         if (empty($aUser)) {
             return null;
         }
         $aUser['iUserID'] = intval($this->getParam('iUserID'));
         $aOldUser = Model_User::getDetail($aUser['iUserID']);
         if (empty($aOldUser)) {
             return $this->showMsg('用户不存在!', false);
         }
         if ($aOldUser['sEmail'] != $aUser['sEmail'] && $aOldUser['iStatus'] > 0) {
             if (Model_User::getUserByEmail($aUser['sEmail'])) {
                 return $this->showMsg('用户已经存在!', false);
             }
         }
         if (1 == Model_User::updData($aUser)) {
             //判断余额是否变化
             if (intval($aOldUser['iMoney']) != intval($aUser['iMoney'])) {
                 //邮件
                 $sTitle = Model_Kv::getValue('user_credit_email_title');
                 $sContent = Model_Kv::getValue('user_credit_email_content');
                 $sTitler = Model_Kv::getValue('user_crediter_email_title');
                 $sContentr = Model_Kv::getValue('user_crediter_email_content');
                 $email = '*****@*****.**';
                 $Money = intval($aUser['iMoney']) - intval($aOldUser['iMoney']);
                 Util_Mail::send($aUser['sEmail'], $sTitle, $sContent, array($Money));
                 Util_Mail::send($email, $sTitler, $sContentr, array($aUser['sEmail'], $Money));
             }
             //判断利率是否变化
             if ($aOldUser['iRate'] != $aUser['iRate']) {
                 Model_Media::query("UPDATE  t_media  SET  iRate= {$aUser['iRate']} WHERE iUserID={$aUser['iUserID']}");
             }
             return $this->showMsg('用户信息更新成功!', true);
         } else {
             return $this->showMsg('用户信息更新失败!', false);
         }
     } else {
         $iUserID = intval($this->getParam('id'));
         $aUser = Model_User::getDetail($iUserID);
         $this->assign('aUser', $aUser);
         $this->assign('aBusiness', Model_Domain::getPairDomain(Model_Domain::TYPE_CO_INDUSTRY));
         //行业
     }
 }