| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- <?php
- namespace common\models\backend;
- use common\models\base\BaseActiveRecord;
- /**
- * This is the model class for table "qimall_video_tutorials_log".
- *
- * @property int $id
- * @property int $admin_id 账户id
- * @property int $video_tutorials_id 视频教程id
- * @property int $is_complete 是否完整观看;1:是;0否
- * @property int $view_times 浏览时长
- * @property int $created_at
- * @property int $updated_at
- * @property int|null $status 状态[-1:删除;0:禁用;1启用]
- */
- class VideoTutorialsLog extends BaseActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return '{{%video_tutorials_log}}';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['admin_id', 'video_tutorials_id', 'is_complete', 'view_times', 'created_at', 'updated_at', 'status'], 'integer'],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'admin_id' => '账户id',
- 'video_tutorials_id' => '视频教程id',
- 'is_complete' => '是否完整观看;1:是;0否',
- 'view_times' => '浏览时长',
- 'created_at' => 'Created At',
- 'updated_at' => 'Updated At',
- 'status' => '状态[-1:删除;0:禁用;1启用]',
- ];
- }
- public static function addVideoTutorialsLog($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;
- }
- }
- }
|