100], [['voucher_img'], 'string', 'max' => 255], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'mall_id' => '商城id', 'store_id' => '门店id', 'store_commission_id' => '提成明细id', 'order_no' => '订单编号', 'voucher_img' => '凭证图片', 'check_status' => '审核状态[0:待审核;1:已同意;2:已驳回]', 'created_at' => 'Created At', 'updated_at' => 'Updated At', 'status' => '状态[-1:删除;0:禁用;1启用]', ]; } public static function setData(array $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() . $e->getLine() . $e->getFile(); return false; } } public static function check($ids, $mall_id, $chek_status,$store_id,$order_no) { $t = Yii::$app->db->beginTransaction(); try { if ($chek_status == 1) { //通过 Store::settlementStoreCommission('', $store_id, $order_no);//结算货款 } $res = self::updateAll(['check_status' => $chek_status], ['id' => $ids, 'mall_id' => $mall_id]); if ($res == false) throw new \Exception(self::getStaticError()); $t->commit(); return true; } catch (\Exception $e) { $t->rollBack(); self::$static_error = $e->getMessage(); return false; } } }