| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071 |
- <?php
- namespace addons\AvoidTax\common\models;
- use Yii;
- /**
- * This is the model class for table "{{%addons_tax_order_list}}".
- *
- * @property int $id
- * @property int $mall_id
- * @property int $order_id
- * @property string $name
- * @property string $account
- * @property float $amount
- * @property int $created_at
- */
- class TaxOrderList extends \yii\db\ActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return '{{%addons_tax_order_list}}';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['mall_id', 'order_id', 'created_at'], 'integer'],
- [['amount'], 'number'],
- [['name'], 'string', 'max' => 32],
- [['account'], 'string', 'max' => 64],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'mall_id' => 'Mall ID',
- 'order_id' => 'Order ID',
- 'name' => 'Name',
- 'account' => 'Account',
- 'amount' => 'Amount',
- 'created_at' => 'Created At',
- ];
- }
- /**
- * 批量插入汇款
- *
- * @param array $list
- * @return boolean
- */
- public function addList($list)
- {
- if (empty($list)) return false;
- $field = array_keys($list[array_key_first($list)]);
- return Yii::$app->db->createCommand()->batchInsert(self::tableName(), $field, $list)->execute();
- }
- }
|