| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- <?php
- namespace common\models\order;
- use Yii;
- /**
- * This is the model class for table "{{%order_batch_delivery}}".
- *
- *
- * @property int $id ID
- * @property int $mall_id 商城ID
- * @property int $operator_id 操作人ID
- * @property string $operator_name 操作人昵称
- * @property string $delivery_file 批量发货文件地址
- * @property int $express_id 快递公司id
- * @property string $express_name 物流公司名称
- * @property int $delivery_num 发货单数
- * @property int $success_delivery_num 成功发货单数
- * @property int $delivery_status 批量发货状态【0:处理中,1:已完成】
- * @property int $status 状态【1启用 0禁用 -1删除】
- * @property int $created_at 创建时间
- * @property int $updated_at 更新时间
- */
- class OrderBatchDelivery extends \common\models\base\BaseActiveRecord
- {
- /**
- * {@inheritdoc}
- */
- public static function tableName()
- {
- return '{{%order_batch_delivery}}';
- }
- /**
- * {@inheritdoc}
- */
- public function rules()
- {
- return [
- [['mall_id', 'operator_id', 'express_id', 'delivery_num', 'success_delivery_num', 'delivery_status', 'status', 'created_at', 'updated_at'], 'integer'],
- [['operator_name', 'express_name'], 'string', 'max' => 100],
- [['delivery_file'], 'string', 'max' => 500],
- ];
- }
- /**
- * {@inheritdoc}
- */
- public function attributeLabels()
- {
- return [
- 'id' => 'ID',
- 'mall_id' => '商城ID',
- 'operator_id' => '操作人ID',
- 'operator_name' => '操作人昵称',
- 'delivery_file' => '批量发货文件地址',
- 'express_id' => '快递公司id',
- 'express_name' => '物流公司名称',
- 'delivery_num' => '发货单数',
- 'success_delivery_num' => '成功发货单数',
- 'delivery_status' => '批量发货状态【0:处理中,1:已完成】',
- 'status' => '状态【1启用 0禁用 -1删除】',
- 'created_at' => '创建时间',
- 'updated_at' => '更新时间',
- ];
- }
- /**
- * 保存数据
- * @Author: lun
- * @DateTime: 2021/12/1 0001 18:47
- * @Copyright: copyright (c) 2021 广东七件事集团
- * @param $mall_id
- * @param $params
- * @return bool
- */
- public static function setData($mall_id, $params)
- {
- try {
- $mobel = new self();
- $mobel->mall_id = $mall_id;
- if (!$mobel->load($params, '') || !$mobel->save()) throw new \Exception($mobel->getErrorMessage());
- return $mobel;
- } catch (\Exception $e) {
- self::setStaticError($e->getMessage());
- return false;
- }
- }
- }
|