public function handle_request() { $brokerId = $this->request->get_parameter('brokerId'); $udid2 = $this->request->get_parameter('udid2'); $guid = $this->request->get_parameter('guid'); $macId = $this->request->get_parameter('macId'); $appName = $this->request->get_parameter('appName'); $testType = $this->request->get_parameter('testType'); $requireId = $this->request->get_parameter('requireId'); if ($this->request->is_post_method()) { if ($appName == 'a-ajk') { $userId = $guid . $macId; } else { $userId = $udid2; } if ($testType == 'customer') { Model_Broker_BrokerFindUser::create(array('uploadDt' => date('Y-m-d'), 'uploadTime' => date('Y-m-d m:i:s'), 'userId' => $userId, 'chatId' => 0, 'brokerId' => $brokerId, 'guid' => $guid, 'macId' => $macId, 'udid2' => $udid2, 'appName' => $appName, 'lastOperateTime' => date('Y-m-d m:i:s'), 'commPreference' => '579590,396874,381240', 'houseTypePreference' => '2室', 'pricePreference' => '200-300万', 'viewPropNum' => '12', 'viewPropList' => '221055282,221054044,221054035', 'commPreferenceDesc' => 'TCL雅园,保利山水城,雅居乐世纪新城', 'bankuaiPreference' => '040004400442', 'bankuaiPreferenceDesc' => '沙头角'))->save(); } else { if ($testType == 'require') { Model_Broker_BrokerUserRequire::create(array('calDt' => date('Y-m-d'), 'uploadTime' => date('Y-m-d m:i:s'), 'requireId' => $requireId, 'userId' => $userId, 'chatId' => 0, 'brokerId' => $brokerId, 'guid' => $guid, 'macId' => $macId, 'udid2' => $udid2, 'appName' => $appName))->save(); } } $this->setAttribute('out', 1); } return 'Test_CreateDataForCustomerRush'; }
public function handle_request() { if ($this->request->is_post_method()) { $brokerId = $this->request->get_parameter('brokerId'); $deviceId = $this->request->get_parameter('deviceId'); //删除da_mobile_broker_find_user_upload表跟制定broker_id相关的数据 $brokerFindUserData = Model_Broker_BrokerFindUser::data_access()->filter('brokerId', $brokerId)->find(); foreach ($brokerFindUserData as $val) { $val->delete(); } //删除da_mobile_broker_find_user_upload表跟制定device_id相关的数据 $brokerFindUserData = Model_Broker_BrokerFindUser::data_access()->filter('userId', $deviceId)->find(); foreach ($brokerFindUserData as $val) { $val->delete(); } //删除broker_user_relation_XX表跟制定brokerId相关的数据 $brokerUserRelationData = Model_Mobile_BrokerUserRelation::data_access()->filter('brokerId', $brokerId)->find(); foreach ($brokerUserRelationData as $val) { $val->delete(); } //删除broker_user_relation_XX表跟制定user_device_id相关的数据 $brokerUserRelationData = Model_Mobile_BrokerUserRelation::data_access()->filter('userDeviceId', $deviceId)->find(); foreach ($brokerUserRelationData as $val) { $val->delete(); } //删除broker_bind表跟制定brokerId相关的数据 $brokerBindData = Model_Mobile_BrokerBind::data_access()->filter('brokerId', $brokerId)->find(); foreach ($brokerBindData as $val) { $val->delete(); } //删除user_bind表跟制定device_id相关的数据 $userBindData = Model_Mobile_UserBind::data_access()->filter('deviceId', $deviceId)->find(); foreach ($userBindData as $val) { $val->delete(); } $this->setAttribute('out', 1); } return 'Test_TruncateDataForCustomerRush'; }
public function get_broker_list() { $houses = Model_Broker_BrokerFindUser::data_access()->filter_by_op('id', '>', $this->cursor['id'])->limit($this->per)->sort('id', 'asc')->find_all(); return $houses; }
private function getNextDataById($id) { $return = false; $props = Model_Broker_BrokerFindUser::data_access()->filter_by_op('id', '>=', $id)->find_only(); if (!empty($props)) { $return = true; } return $return; }