海南旅游SAAS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

50 lines
1.3 KiB

4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
  1. <?php
  2. namespace App\Providers;
  3. use App\Models\Demand;
  4. use App\Models\DemandBidding;
  5. use App\Service\SmsService;
  6. use App\Traits\DemandTraits;
  7. use Illuminate\Support\Facades\Log;
  8. use Illuminate\Support\ServiceProvider;
  9. class DemandBiddingServiceProvider extends ServiceProvider
  10. {
  11. /**
  12. * Register services.
  13. *
  14. * @return void
  15. */
  16. public function register()
  17. {
  18. //
  19. }
  20. /**
  21. * Bootstrap services.
  22. *
  23. * @return void
  24. */
  25. public function boot()
  26. {
  27. //DemandBidding::created(function ($order) {
  28. // $demand = Demand::query()->with(['publisher'])->where('id',$order->demand_id)->first();
  29. // if(!empty($demand->publisher->contact_phone)) {
  30. // $sms = new SmsService();
  31. // $sms->send('bidding',[$order->biddingUser->name,$demand->id,DemandTraits::$polymorphic[$demand->publisher_type]],[$demand->publisher->contact_phone]);
  32. // }
  33. //});
  34. //
  35. //
  36. //Demand::updated(function ($demand) {
  37. // //如果状态改变了
  38. // if($demand->isDirty('bidding_id')) {
  39. // if(!empty($demand->publisher->contact_phone)) {
  40. // $sms = new SmsService();
  41. // $sms->send('bidding',[$demand->publisher->name,$demand->id,DemandTraits::$polymorphic[$demand->bidding_user_type]],[$demand->biddingUser->contact_phone]);
  42. // }
  43. // }
  44. //});
  45. }
  46. }