public static final boolean changeStatus(OrderInfo order) { OrderInfo model = OrderInfo.dao.findFirst( "select * from orderInfo where deleted=0 and uuid=?", order.getStr("uid")); if (model != null) { model.set("status", order.getStatus()); return model.save(); } return false; }
@Before(Tx.class) public static final boolean create(OrderInfo order) { ModelUtil.generateUUID(order); order.set("createTime", new Date()); for (OrderInfoDetail detail : order.getDetails()) { ModelUtil.generateUUID(detail); detail.setOrderId(order.getStr("uid")); detail.save(); } return order.save(); }