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; }