AddonsStartFormSmsNotice.php 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. <?php
  2. namespace addons\SmartForm\common\models;
  3. use common\models\user\User;
  4. use Yii;
  5. /**
  6. * This is the model class for table "qimall_addons_smart_form_sms_notice".
  7. *
  8. * @property int $id
  9. * @property int|null $status 状态[0:禁用;1:启用,2:已过期]
  10. * @property int $created_at 添加时间
  11. * @property int $updated_at
  12. * @property int $mall_id
  13. * @property int $user_id 发送号码
  14. * @property string $content 发送内容
  15. * @property string $template_id 发送内容
  16. * @property int $send_at 发送时间
  17. * @property string|null $send_var 发送变量
  18. * @property int $send_status 0待发送,2发送中,50发送失败,100发送成功
  19. * @property int $column_id 0待发送,2发送中,50发送失败,100发送成功
  20. * @property array|null $send_res 发送结果
  21. * @property int $user_form_id 发送结果
  22. * @property int $goods_id 发送结果
  23. * @property int $order_id 发送结果
  24. */
  25. class AddonsStartFormSmsNotice extends \common\models\base\BaseActiveRecord
  26. {
  27. /**
  28. * {@inheritdoc}
  29. */
  30. public static function tableName()
  31. {
  32. return 'qimall_addons_smart_form_sms_notice';
  33. }
  34. /**
  35. * {@inheritdoc}
  36. */
  37. public function rules()
  38. {
  39. return [
  40. [['status', 'created_at', 'updated_at', 'mall_id', 'send_at', 'send_status', 'user_id',
  41. 'column_id', 'user_form_id', 'goods_id', 'order_id'], 'integer'],
  42. [['send_var', 'send_res'], 'safe'],
  43. [['content'], 'string', 'max' => 255],
  44. [['template_id'], 'string', 'max' => 50],
  45. ];
  46. }
  47. /**
  48. * {@inheritdoc}
  49. */
  50. public function attributeLabels()
  51. {
  52. return [
  53. 'id' => 'ID',
  54. 'status' => 'Status',
  55. 'created_at' => 'Created At',
  56. 'updated_at' => 'Updated At',
  57. 'mall_id' => 'Mall ID',
  58. 'mobile' => 'Mobile',
  59. 'content' => 'Content',
  60. 'send_at' => 'Send At',
  61. 'send_var' => 'Send Var',
  62. 'send_status' => 'Send Status',
  63. 'send_res' => 'Send Res',
  64. ];
  65. }
  66. public function getUser()
  67. {
  68. return $this->hasOne(User::class, ['id' => 'user_id'])->select('id, mobile, username, nickname, area_code');
  69. }
  70. public function getUserForm()
  71. {
  72. return $this->hasOne(AddonsSmartFormTemplateUserForm::class, ['id' => 'user_form_id']);
  73. }
  74. }