Guest User

Untitled

a guest
Jan 17th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. use Model;
  2. use AlexServicesModelsService;
  3. /**
  4. * Model
  5. */
  6. class Order extends Model
  7. {
  8. use OctoberRainDatabaseTraitsValidation;
  9.  
  10. /*
  11. * Disable timestamps by default.
  12. * Remove this line if timestamps are defined in the database table.
  13. */
  14. public $timestamps = false;
  15.  
  16.  
  17. /**
  18. * @var string The database table used by the model.
  19. */
  20. public $table = 'alex_services_orders';
  21.  
  22. /**
  23. * @var array Validation rules
  24. */
  25. public $rules = [
  26. ];
  27.  
  28. /*Relations*/
  29.  
  30. public $belongsToMany = [
  31. 'services' =>[
  32. 'AlexServicesModelsService',
  33. 'table' => 'alex_services_services_orders',
  34. 'order' => 'name'
  35. ]
  36.  
  37. ];
  38. // я вывел список услуг в выпадающий список
  39. public function getServicesOptions(){
  40. return Service::lists('name', 'id');
  41. }
  42. }
Add Comment
Please, Sign In to add comment