|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- <?php
- /**
- * 数据库表类 log_order
- * ============================================================================
- * * 版权所有 蜘蛛出行 * *
- * 网站地址: http://www.zhizhuchuxing.com
- * ----------------------------------------------------------------------------
- * 这不是一个自由软件!您只能在不用于商业目的的前提下对程序代码进行修改和
- * 使用;不允许对程序代码以任何形式任何目的的再发布。
- * ============================================================================
- * Author By: 倪宗锋
- * PhpStorm LoginController.php
- * Create By 2017/11/21 17:44 $
- */
-
- namespace common\models;
-
- use common\util\Util;
- use yii\db\ActiveRecord;
- use yii\db\Exception;
-
- /**
- * 数据库表类 log_order.
- * @property integer $id
- * @property string $name
- * @property integer $order_id
- * @property string $time
- * @property integer $uid
- * @property integer $u_type
- * @property integer $log_type
- */
- class LogOrder extends ActiveRecord
- {
- /**
- * @inheritdoc
- */
- public static function tableName()
- {
- return 'log_order';
- }
-
- /**
- * @inheritdoc
- */
- public function rules()
- {
- return [
- [['order_id', 'uid', 'u_type', 'log_type'], 'integer'],
- [['time'], 'safe'],
- [['name'], 'string', 'max' => 20],
- ];
- }
-
- /**
- * @inheritdoc
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'name' => 'Name',
- 'order_id' => 'Order ID',
- 'time' => 'Time',
- 'uid' => 'Uid',
- 'u_type' => 'U Type',
- 'log_type' => 'Log Type',
- ];
- }
-
- /**
- * Des:添加记录
- * Name: addInfo
- * @param $data
- * @return bool
- * @author 倪宗锋
- */
- public function addInfo($data)
- {
- try {
- $this->setAttributes($data);
- $res = $this->save(false);
- if ($res == false) {
- return false;
- }
- return true;
- } catch (Exception $e) {
- return false;
- }
- }
- }
|