TimestampBehavior::class, 'attributes' => [ ActiveRecord::EVENT_BEFORE_INSERT => ['created_at'], ] ] ]; } /** * @inheritdoc */ public function rules() { return [ [[ 'store_id', 'store_settle_id','yc_settle_id'], 'integer'], [['order_no'], 'string'], [['money'], 'number'], [['created_at'], 'safe'] ]; } public static function createRecord($money,$store_id,$store_settle_id,$yc_settle_id){ try { $record = new self(); $record->money=$money; $record->store_id=$store_id; $record->store_settle_id=$store_settle_id; $record->yc_settle_id=$yc_settle_id; $record->order_no=\app\utils\OrderNo::getOrderNo(\app\utils\OrderNo::SOTRE_YC_OPERATION); if (!$record->save())throw new ErrorException('保存失败'.json_encode($record->getErrors())); return true; }catch (ErrorException $e){ //debug_log([__METHOD__, __LINE__, "发放是失败 {$e->getMessage() }"], "app_debug_partner.log"); return false; } } }