| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <?php
- namespace common\models\wechat;
- use Yii;
- /**
- * This is the model class for table "qimall_wechat_send_message_log".
- *
- * @property int $id
- * @property int $mall_id 商城ID
- * @property int $user_id 会员id
- * @property string $openid
- * @property string|null $send_data 发送参数
- * @property string|null $result_data 返回参数
- * @property int $updated_at
- * @property int $created_at
- */
- class WechatSendMessageLog extends \common\models\base\BaseActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return '{{%wechat_send_message_log}}';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['mall_id', 'user_id','updated_at', 'created_at'], 'integer'],
- [['openid','send_data', 'result_data'], 'string'],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'mall_id' => '商城ID',
- 'user_id' => '会员id',
- 'openid' => 'openid',
- 'send_data' => '发送参数',
- 'result_data' => '返回参数',
- 'updated_at' => 'Updated At',
- 'created_at' => 'Created At',
- ];
- }
- public static function add(array $params)
- {
- try {
- $model = new self();
- $model->loadDefaultValues();
- if (!$model->load($params, '') || !$model->save()) throw new \Exception($model->getErrorMessage());
- return $model;
- } catch (\Exception $e) {
- self::$static_error = $e->getMessage();
- return false;
- }
- }
- }
|