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.

31 lines
709 B

7 years ago
  1. <?php
  2. namespace App\Http\Model;
  3. //短信发送记录
  4. class SmsLog extends BaseModel
  5. {
  6. const SUCCESS = 1;
  7. const FAIL = 2;
  8. protected $table = 'sms_log';
  9. public $guarded = [];
  10. public static function success($mobile, $text, $result)
  11. {
  12. self::create([
  13. 'mobile' => $mobile,
  14. 'text' => $text,
  15. 'status' => self::SUCCESS,
  16. 'result' => json_encode($result)
  17. ]);
  18. }
  19. public static function fail($mobile, $text, $result)
  20. {
  21. self::create([
  22. 'mobile' => $mobile,
  23. 'text' => $text,
  24. 'status' => self::FAIL,
  25. 'result' => json_encode($result)
  26. ]);
  27. }
  28. }