findByPk($lewaimai_customer_id); if (!$lewaimaicustomerModel) { return ; } $openid = $lewaimaicustomerModel->openid; $staffticketcustomerModel = StaffTicketCustomer::model()->find("openid = '" . $openid . "'"); if (!$staffticketcustomerModel) { return ; } //如果找到了,那么就加次数 $staffticketcustomerModel->waimai_num += 1; $staffticketcustomerModel->order_num += 1; if (!$staffticketcustomerModel->update()) { LewaimaiDebug::LogModelError($staffticketcustomerModel); return ; } $ticket_id = $staffticketcustomerModel->ticket_id; $staffticketModel = StaffTicket::model()->findByPk($ticket_id); if (!$staffticketModel) { return ; } $staffticketModel->waimai_num += 1; $staffticketModel->order_num += 1; if (!$staffticketModel->update()) { return ; } } public static function UpdateStaffTicketPaotuiNum($lewaimai_customer_id) { $lewaimaicustomerModel = LewaimaiCustomer::model()->findByPk($lewaimai_customer_id); if (!$lewaimaicustomerModel) { return ; } $openid = $lewaimaicustomerModel->openid; $staffticketcustomerModel = StaffTicketCustomer::model()->find("openid = '" . $openid . "'"); if (!$staffticketcustomerModel) { return ; } //如果找到了,那么就加次数 $staffticketcustomerModel->paotui_num += 1; $staffticketcustomerModel->order_num += 1; if (!$staffticketcustomerModel->update()) { LewaimaiDebug::LogModelError($staffticketcustomerModel); return ; } $ticket_id = $staffticketcustomerModel->ticket_id; $staffticketModel = StaffTicket::model()->findByPk($ticket_id); if (!$staffticketModel) { return ; } $staffticketModel->paotui_num += 1; $staffticketModel->order_num += 1; if (!$staffticketModel->update()) { return ; } } }