Exemplo n.º 1
0
 /**
  * 获取返钱队列actType id
  * //todo 由于项目时间太紧,未创建对应的BLL
  * @return array
  */
 public function getTypeId()
 {
     $date = APF::get_instance()->get_request()->get_parameter('date');
     $actType = $this->cmsBackQueueActType;
     //先查询当天的记录
     $sqlResult = Model_Broker_AjkPpccoinType::data_access()->filter_by_op('acttype', '=', $actType)->filter_by_op('typedate', '=', $date)->find_only();
     //没有对应的记录,插入一条新记录
     if (empty($sqlResult)) {
         $mysqlAccessor = new Model_Broker_AjkPpccoinType();
         $mysqlAccessor->acttype = $this->cmsBackQueueActType;
         $mysqlAccessor->detail = 'CMS返钱工具化队列';
         $mysqlAccessor->addtime = time();
         $mysqlAccessor->typedate = $date;
         $mysqlAccessor->save();
         $result = array('status' => 'success', 'info' => $mysqlAccessor->id);
     } else {
         $result = array('status' => 'success', 'info' => $sqlResult->id);
     }
     return $result;
 }