Blame view

domain/device/DeviceAuthFail.php 854 Bytes
931eed21   xu   1. A授权接口开发
1
2
3
4
<?php

namespace domain\device;

f10a8ca1   xu   1. F API 授权接口调整
5
6
use Yii;
use domain\device\models\DeviceAuthFail as DeviceAuthFailModel;
931eed21   xu   1. A授权接口开发
7
8
9

class DeviceAuthFail
{
f10a8ca1   xu   1. F API 授权接口调整
10
11
12
13
14
    /**
     * @param $item
     * @return null|object
     * @throws \yii\base\InvalidConfigException
     */
931eed21   xu   1. A授权接口开发
15
16
    static function create($item)
    {
f10a8ca1   xu   1. F API 授权接口调整
17
18
19
20
21
22
23
24
25
26
27
28
29
30
        $failModel = Yii::createObject([
            'class'             => DeviceAuthFailModel::className(),
            'manufacture_no'    => $item['manufacture_no'],
            'project_no'        => $item['project_no'],
            'model_no'          => $item['model_no'],
            'production_no'     => $item['production_no'],
            'device_id'         => $item['device_id'],
            'apply_at'          => time(),
        ]);
        if ($failModel->save()) {
            return $failModel;
        } else {
            return null;
        }
931eed21   xu   1. A授权接口开发
31
32
    }
}